Online Store

MIFARE® Card Programming - µFR Simple Software SDK

Simple MIFARE® Cards reading & writing source code software example

MIFARE SDK available in the following programming languages

  • Java (including Applet),
  • JavaScript,
  • Lazarus,
  • Borland Delphi,
  • C++ Builder,
  • Microsoft® Visual C++ .NET,
  • Microsoft® Visual C# .NET,
  • Microsoft® Visual Basic .NET

Docs & Software Download

General functions for working with the RFID reader

    • ReaderOpen: Opens a port of connected reader. In the case of multi-thread applications, developers must be careful to synchronize access to RFID reader’s resources to avoid unforeseen situations.MIFARE SDK - uFR Simple software with SDK for MIFARE cards 1
    • GetReaderType: Returns the device type identifier. On IS21 readers this value is 0xD1150021.
    • GetReaderSerialNumber: Returns the device serial number.
    • GetCardId: This function returns the type identifier and card serial number placed into the RFID reader.
    • ReaderClose: Closes the reader’s port. This enables access to the RFID reader from other processes.

ReaderUISignal:

    The function is used to control the NFC RFID reader light and sound signal. There are four modes of light signals and five sound modes:

    • ucLightSignalMode Defines the light signals mode. It can have values from 0 to 4. A value of 0 indicates light signals inactivity.
    • ucBeepSignalMode Defines the sound signals mode. It can have values from 0 to 5. A value of 0 indicates sound signals inactivity.

General functions 

The function that emulates the linear address space

LinearWrite

This function is used for writing data to the card using the emulation of linear address space. The method for proving authenticity is determined by the suffix in the name of the function:

  • aucData – Pointer to the sequence of bytes containing data for writing on the cardMIFARE SDK - uFR Simple software with SDK for MIFARE cards 2
  • usLinearAddress – Linear address of the card where the data writing is intended
  • usDataLength – Number of bytes for the entry. In AUC data, a minimum usDataLength bytes must be allocated before calling the function
  • lpusBytesWritten – Pointer to an “unsigned short” type variable, where the number of successfully read bytes from the card is written. If the entry is successfully completed this data is equal to the usDataLength parameter. If there was an error in writing some of the blocks, the function returns the number of successfully written bytes over this parameter.
  • ucAuthKey – This parameter defines whether to perform authentication with A key or key B. It can have two values, namely: AUTHENT1A (0x60) or AUTHENT1B (0x61).
  • ucReaderKeyIndex – The default method of authentication (when the functions without a suffix are used) performs the authenticity proving by using the selected key index from the RFID reader. In the linear address mode, this applies to all sectors that are written.

LinearRead

These functions are used for card data reading by using the linear address space emulation.

  • aucData – Pointer to the sequence of bytes where read data will be stored.MIFARE SDK - uFR Simple software with SDK for MIFARE cards 3
  • usLinearAddress – Linear address on the card from which the data want to read
  • usDataLength – Number of bytes for reading. For aucData, a minimum usDataLength bytes must be allocated before calling the function
  • lpusBytesReturned – Pointer to “unsigned short” type variable, where the number of successfully read bytes from the card is written. If the reading is fully managed this data is equal to the usDataLength parameter. If there is an error reading some of the blocks, the function returns all successfully read data in the AUC data before the errors occurrence and the number of successfully read bytes is returned via this parameter
  • ucAuthMode – This parameter defines whether to perform authentication with key A or key B. It can have two values, namely: AUTHENT1A (0x60) or AUTHENT1B (0x61).
  • ucReaderKeyIndex – The default method of authentication (when the functions without a suffix are used) performs the authenticity proving by using the selected key index from the RFID reader. In the linear address mode, this applies to all sectors that are read.

LinearFormatCard

This function is used for formatting a card by rewriting all of the card data with default byte data [32 (Dec), 20(hex)].

  • ucReaderKeyIndex – The default method of authentication (when the functions without a suffix are used) performs the authenticity proving by using the selected key index from the RFID reader. In the linear address mode, this applies to all sectors that are written.

MIFARE SDK - uFR Simple software with SDK for MIFARE cards 4

Print Friendly, PDF & Email