Online Store

PHP Java Applet & JavaScript Card programming SDK

Manual and automatic sending of UID of the detected card to an online database using PHP and Ajax scripts.

Java Applet source code software – SDK includes an example of a uRF Series reader’s API basic implementation. The project includes three software examples with different difficulty levels: Simplest, Simple and Advanced.
The functions implemented in these examples are:

Simplest – get card serial number (UID), linear reading, and linear writing functions
Simple – expanded set of functions, reader and card keys implementation, authentication methods, reader UI signals
Advanced – many advanced functions added, such as card sector and block manipulation, etc.

 

NFC RFID MIFARE® Cards reading & writing PHP -Java Applet - JavaScript source code software

Card UID sending to the online database

Docs & Software Download

General RFID reader operating functions

NFC RFID PHP Java Applet & JavaScript-1

 

  • ReaderOpen: Opens a port of connected RFID reader. In the case of multi-thread applications, developers must be careful to synchronize access to the reader’s resources to avoid unforeseen situations.
  • ReaderClose: Closes the reader’s port. This enables access to the RFID reader from other processes.
  • GetCardId: This function returns the type identifier and card serial number placed into the RFID NFC reader.

General functions

The function that emulates the linear address space

LinearWrite

NFC RFID PHP Java Applet & JavaScript-2
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 names of the functions:

  • aucData – Pointer to the sequence of bytes containing data for writing
  • usLinearAddress – Linear address of the card where the data writing is intended
  • usDataLength – Number of bytes for the entry. In aucData, 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 is 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.

NFC RFID PHP Java Applet & JavaScript-3

LinearRead

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 names of the functions:

  • aucData – Pointer to the sequence of bytes containing data for writing on the card
  • usLinearAddress – Linear address of the card where the data writing is intended
  • usDataLength – Number of bytes for the entry. In aucData, a minimum usDataLength bytes must be allocated before calling the functionNFC RFID PHP Java Applet & JavaScript-4
  • lpusBytesReturned – 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.
  • 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 is 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.

SOFTWARE DOWNLOAD

Go to our GitLab software repository to download the JavaScript example

Print Friendly, PDF & Email