HID Firmware

The HID firmware acts as a USB HID Keyboard and a Vendor-Specific HID device. The device scans for new tags and types the UID (or UID+SAK or the specified block) of a found tag by using virtual keystrokes.

Device modes

RFID device can be in two modes: scanning and application controlled mode. The default mode (i.e. then device mode after POR) is selected via the device settings. Factory defaults set it to scanning mode.

HID Reports

This firmware has two reports

Custom HID commands

Custom HID commands are sent and received via HID report with ID 1. The report always consists of 63 bytes. The report ID is prepended to the data, therefore the full report length is 64 bytes. The first byte (after the ID one) is the command ID. Valid commands are listed below. The next bytes are command parameters. If the command parameters occupy less than 62 bytes, the remaining unused bytes are padding and can have any arbitrary values.

The device answers with a report, where the first byte (after the report ID) is the command id (the same as the request), the next 4 bytes are the error code (32bit unsigned integer, little endian), and the following bytes are command specific. If the command parameters occupy less than 62 bytes, the remaining unused bytes are padding and can have any arbitrary values.

The error code has the following bit fields:

The error code of 0 is OK (i.e. no error). ATTENTION: the data following the error code bytes is valid only if the error code is 0.

Command list:

Abberviations:

Several commands have one 1byte parameter (bValue), that controlls a device state or setting. It can be one of the following:

QUERY 0 query the current state/value
ON 1 enable
OFF 2 disable
SWITCH 3 switch state
DEFAULT 4 relinquish control to the firmware
----- other values treated as QUERY

Device Information

This command queries the firmware version of the device.

LED Control

Buzzer Control

RFID Mode Control

Enable/Disable RF Field

Inventory Scan

One or mode IN reports will be sent by the device. Params: 4 byte: error code 1 byte: L - UID length (0 for the last report) L bytes: UID 1 byte: SAK

Inventory Scan (without Anti-Collision)

Inventory Scan (select next tag)

Check Tag Presence

Select Tag

Get Current Tag Information

Recognized tag types

Read Data Block

A tag must be selected prior to executing this command (either by calling Inventory Scan w/o Anti-Collision, Inventory Scan - next tag, Select Tag, or Tag Info ). The block number must be within the range supported by the tag.

Write Data Block

A tag must be selected prior to executing this command (either by calling Inventory Scan w/o Anti-Collision, Inventory Scan - next tag, Select Tag, or Tag Info ). The block number must be within the range supported by the tag. Data size must be equal to the block size value returned by the tag info command.

Device Settings

The following commands change various device settings. The are executed regardless of the scanning mode. Individual commands change only in-RAM settings. In order to save the current settings to ROM, execute the Settings Write command.

Enable/Disable the LED

This command enables/disables the LED. This setting only affects whether the firmware switches the LED when a tag is detected/lost. Regardless of this setting, you can switch the LED on and off using LED Control command.

Enable/Disable the Buzzer

This command enables/disables the buzzer. This setting only affects whether the firmware switches the buzzer on when a tag is detected or not. Regardless of this setting, you can switch the buzzer on and off using BUZZ Control command.

RFID Receiver Gain

The recevier gain is measured in dBm. The valid range is [18;48]dBm. The default value is 33dBm.

The valid gain values are

If any other value is passed, it will be rounded (to the nearest available value greater than the one pased).

Tag Presence Query Frequency

When in scanning mode, the device queries the tag presence every N ms (default value: 1000ms). This command controls the query frequency (i.e. the interval N). Valid range is [250-65535] ms. Values smaller than the minimum one will be accepted and silently increased to fit in the range. Values greater then the aximum one will result in an error.

Mifare Authentication Key

Mifare Classic tags need an authentication key to be read/written. The following command sets the key (the key type and 6 bytes long key itself), which will be used to authenticate connected Mifare Classic tags. The default value is FF

UID in Uppercase/Lowercase (keyboard mode)

Append/Omit Carriage Return (keyboard mode)

Append/Omit SAK (keyboard mode)

Data selection (scanning mode)

This setting controls data (UID or block) printed when a new tag is detected.

Block number selection (scanning mode)

In scanning mode the device continuously scans whether an RFID tag is present and prints UID or the selected block. This setting controls the block number being printed:

If the block does not exist or cannot be read (ex. due to an authorization failure) nothing is printed.

Write settings to ROM

This command saves the current in-RAM setting to ROM, i.e. makes them permanent

Device Control

The following commands manage the RFID reader device itself:

Device Reboot

Reboot the device.

Firmware Update

Reboot the device and start the bootloader (this command may not be supported by some devices. If not supported, acts as Device Reboot ).

Other commands - RFU

*Params (IN) (4 bytes) error code 0x800 - Generic communication error.