RFID

Members

(inner, constant) Capabilities

Capabilities of the attached RFID Reading/Writing Device

Properties:
Name Type Description
LOCK String

LOCK

UNLOCK String

UNLOCK

"LED-RED" String

LED-RED

"LED-BLUE" String

LED-BLUE

"LED-WHITE" String

LED-WHITE

SENSE String

SENSE

"MIFARE-CLASSIC" String

MIFARE-CLASSIC

"MIFARE-PLUS" String

MIFARE-PLUS

"MIFARE-DESFIRE" String

MIFARE-DESFIRE

(inner, constant) CardType

The Card Types

Properties:
Name Type Description
MIFARE_CLASSIC_1K String

MIFARE_CLASSIC_1K

MIFARE_CLASSIC_4K String

MIFARE_CLASSIC_4K

(inner, constant) DeviceConnectivityStatus

Properties:
Name Type Description
Connected

1

Disconnected

2

(inner, constant) DeviceOperationalStatus

Properties:
Name Type Description
Operational

1

Unknown

2

Error

4

Inactive

8

(inner, constant) InputEncoding

Properties:
Name Type Description
Default
Binary
Base64
Buffer
UInt8Array
ArrayBuffer

(inner, constant) LEDColor

The available LED Colors

Properties:
Name Type Description
RED Number

0

GREEN Number

1

BLUE Number

2

WHITE Number

4

(inner, constant) OutputEncoding

Properties:
Name Type Description
Default

default

Binary

binary

Base64

base64

Buffer

buffer

UInt8Array

uint8array

ArrayBuffer

arraybuffer

Type Definitions

AgentCancelledException :Object

Exception thrown when an in progress read or write is cancelled.

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.Cancelled'

name String

The name of the error, in this case it is 'AgentCancelledException'

stack String

The stack trace from where this error was instantiated.

AgentNotEnabledException :Object

Exception thrown when the device is not enabled and you attempt to perform an action

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.NotEnabled'

name String

The name of the error, in this case it is 'AgentNotEnabledException'

stack String

The stack trace from where this error was instantiated.

Block :Object

Properties:
Name Type Description
index Number

The index of the block

data Array.<UInt8>

The data contained within the block

CannotLockException :Object

Exception thrown when you attempt to lock the card but the RFID reader cannot lock (Card obstructing the lock)

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.CannotLock'

name String

The name of the error, in this case it is 'CannotLockException'

stack String

The stack trace from where this error was instantiated.

CannotWriteReservedException :Object

Exception thrown when you attempt to write to a reserved block

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.CannotWriteReserved'

name String

The name of the error, in this case it is 'CannotWriteReservedException'

stack String

The stack trace from where this error was instantiated.

CardQueryResult :Object

Properties:
Name Type Description
uid String

The UID of the card

type String

The type of Mifare Card

capacity Number

The capacity in bytes of the card

Descriptor :Object

Properties:
Name Type Description
vendorId Number

USB Vendor ID

productId Number

USB Product ID

DeviceInfo :Object

Properties:
Name Type Description
status Status

Information about the status of this device.

driverVersion String

The version of the driver

device USBDeviceInfo

The device info from the USB API

manufacturer String

The manufacturer name

model String

The model name

currentFirmware String

The current firmware version

requiresSupportedFirmware Boolean

If this driver requires the peripheral to have a specific firmware version

supportedFirmwares Array.<String>

Array of supported firmware versions

supportedDescriptors Array.<module:RFID~Descriptor>

List of support device vendorId, productId pairs.

DisconnectedException :Object

Exception thrown when you attempt to perform a function and the RFID reader/writer is not connected.

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.Disconnected'

name String

The name of the error, in this case it is 'DisconnectedException'

stack String

The stack trace from where this error was instantiated.

InvalidAccessPermissionException :Object

Exception thrown when you attempt to read, write, increment, decrement a block without the appropriate permission.

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.InvalidAccessPermission'

name String

The name of the error, in this case it is 'InvalidAccessPermissionException'

stack String

The stack trace from where this error was instantiated.

InvalidCapabilityException :Object

Exception thrown when you attempt to perform a function the attached RFID reader/writer is incapable of performing.

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.InvalidCapability'

name String

The name of the error, in this case it is 'InvalidCapabilityException'

stack String

The stack trace from where this error was instantiated.

InvalidKeysException :Object

Exception thrown when invalid keys a provided to the read or write commands

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.InvalidKeys'

name String

The name of the error, in this case it is 'InvalidKeysException'

stack String

The stack trace from where this error was instantiated.

InvalidParameterException :Object

Exception thrown when an invalid parameter is provided.

Properties:
Name Type Description
code String

The code of the error, in this case it is 'Agent.RFID.InvalidParameter'

name String

The name of the error, in this case it is 'InvalidParameterException'

stack String

The stack trace from where this error was instantiated.

Keys :Object

Properties:
Name Type Description
a Array.<Number>

The A key (6 bytes)

b Array.<Number>

The B key (6 bytes)

ReadConfiguration :Object

Properties:
Name Type Description
sectors Array.<module:RFID~SectorReadConfig>

The array of sector configuration describing which sectors to read.

ReadOptions :Object

Properties:
Name Type Description
skipInsert Boolean
skipRemove Boolean
skipRelease Boolean

ReadResult :Object

Properties:
Name Type Description
sectors Array.<module:RFID~Sector>

The sectors on the card

nuid Number

The NON-Unique ID of this card if applicable

uid Number

The Unique ID of this card if applicable.

capacity Number

The Capacity of this card.

type CardType

The type of this card.

RFIDDeviceInfo :Object

Properties:
Name Type Description
capabilities Capabilities

List of capabilities of the attached device

manufacturer String

The device manufacturer

model String

The device model

vendorId Number

The device usb vendor id

productId Number

The device usb product id

serial String

The device serial number

Sector :Object

Properties:
Name Type Description
index Number

The index of the sector

keys SectorKeys

The keys of this sector

blocks Array.<module:RFID~Block>

The blocks of the sector

access Access

The access of the sector

SectorAccess :Object

Properties:
Name Type Description
read Boolean

Read Access

write Boolean

Write Access

increment Boolean

Increment Access

decrement Boolean

Decrement Access

SectorKeys :Object

Properties:
Name Type Description
a Array.<UInt8>

Key A must be 8 bytes. i.e. [0, 2, 8, 64, 128, 192, 224, 255]

b Array.<UInt8>

Key B must be 8 bytes. i.e. [0, 2, 8, 64, 128, 192, 224, 255]

SectorReadBlock :Object

Properties:
Name Type Description
index Number

The index of the block to read

SectorReadConfig :Object

Properties:
Name Type Description
index Number

The index of the sector to read.

keys SectorKeys

The unlock to read key(s)

blocks Array.<module:RFID~SectorReadBlock>

The blocks to read

SectorWriteBlock :Object

Properties:
Name Type Description
index Number

The index of the block to Write

data Array.<UInt8>

The data to write to this block.

SectorWriteConfig :Object

Properties:
Name Type Description
index Number

The index of the sector to Write.

keys SectorKeys

The unlock to Write key(s)

blocks Array.<module:RFID~SectorWriteBlock>

The blocks to Write

updateKeys SectorKeys

The keys to update.

access Array.<UInt8>

The access properties to change see: here.

Status :Object

Properties:
Name Type Description
connectivityStatus DeviceConnectivityStatus
operationalStatus DeviceOperationalStatus

USBDeviceInfo :Object

Properties:
Name Type Description
device Number

USB Handle ID

vendorId Number

USB Vendor ID

productId Number

USB Product ID

version Number

USB BCD Device

productName String

Product Name

manufacturerName String

Manufacturer Name

serial String

Serial No

WriteConfiguration :Object

Properties:
Name Type Description
sectors Array.<module:RFID~SectorWriteConfig>

The array of sector configuration describing which sectors to read.

WriteOptions :Object

Properties:
Name Type Description
skipSectorZeroBlockZero Boolean
skipInsert Boolean
skipRemove Boolean
skipRelease Boolean