Site Tools


r502-api-manual

R502 Spy Library API Manual

R502 Spy Library is an operation API library of R502 SPY reader. Now it contains ISO14443 TypeA protocol debug API interface, Mifare Classic card command debug API interface. For any question, please contact javacardos@gmail.com .

API introduction

1. Constructor and initialization

Constructor

  • Parameter: scinterface
  • Return: Smartcard debug object.

init()

  • Function: Initialization.
  • Parameter: Null.
  • Return: Null.

rfOn()

  • Function: Open smartcard reader electromagnetic field.
  • Parameter: Null.
  • Return:
    1. True if the command is executed successfully.
    2. False if failed to execute the command.

rfOff()

  • Function: Close smartcard reader electromagnetic field.
  • Parameter: Null.
  • Return:
    1. True if the command is executed successfully.
    2. False if failed to execute the command.

rfAuto()

  • Function: Set smartcard reader debug function to automatic status. In this status, anti-collision will be completed automatically.
  • Parameter: Null.
  • Return:
    1. True if the command is executed successfully.
    2. False if failed to execute the command.

rfManaul()

  • Function: Set smartcard reader debug function to manual operation status. In this status, anti-collision program will be implemented by calling API interface.
  • Parameter: Null.
  • Return:
    1. True if the command is executed successfully.
    2. False if failed to execute the command.

3. ISO14443 TypeA protocol API

claREQA(commandValue)

  • Function: Send REQA command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. It is 0x26 as defined in ISO14443 specification.
  • Return:
    1. (True, command response value: ATQA) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claWUPA(commandValue)

  • Function: Send WUPA command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. It is 0x52 as defined in ISO14443 specification.
  • Return:
    1. (True, command response value: ATQA) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claAnticollision(commandValue)

  • Function: Send ANTICOLLISION command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. e.g.: e.g.: ‘93 20’, ‘95 20’, ‘97 20’.
  • Return:
    1. (True, command response value: UID CLn) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claSelect(commandValue)

  • Function: Send SELECT command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. e.g.: ‘93 70’ + UID, ‘95 70’ + UID, ‘97 70’ + UID.
  • Return:
    1. (True, command response value: SAK) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claRATS(commandValue)

  • Function: Send RATScommand of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. The format defined in specification: he format defined in specification: ‘E0’ + Parameter byte.
  • Return:
    1. (True, command response value: ATS) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claHLTA(commandValue)

  • Function:Send HLTA command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. The format defined in specification: ‘50 00’.
  • Return:
    1. (True, command response value) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

claPPS(commandValue)

  • Function:Send PPS command of ISO14443 TypeA.
  • Parameter: commandValue: the value of command. The format defined in specification: PPSS + PPS0 + PPS1.
  • Return:
    1. (True, command response value) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

4. ISO14443 Block protocol API

clTransmit(commandValue)

  • Function: Send ISO14443 block.
  • Parameter: commandValue: the value of command. It can be I-Block, R-Block or S-Block.
  • Return:
    1. (True, block response value) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

5. MIFARE Command API

mifareAuthentication(commandValue)

  • Function: Send MIFARE Authentication command.
  • Parameter: commandValue: the value of command.Auth type + Mifare Block Addr + (authentication key(6 bytes) + UID).
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareBlockRead(commandValue)

  • Function: Send MIFARE Read command.
  • Parameter: commandValue: the value of command.It is 0x30 + Mifare Block Addr.
  • Return:
    1. (True, block data) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareBlockWrite(commandValue)

  • Function: Send MIFARE Write command.
  • Parameter: commandValue: the value of command It is 0xA0 + Mifare Block Addr + Data(16bytes).
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareIncrement(commandValue)

  • Function: Send MIFARE Increment command.
  • Parameter: commandValue: the value of command.It is 0xC1 + Mifare Block Addr + Data(16 bytes).
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareDecrement(commandValue)

  • Function: Send MIFARE Decrement command.
  • Parameter: commandValue: the value of command.It is 0xC0 + Mifare Block Addr + Data(16bytes).
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareRestore (commandValue)

  • Function: Send MIFARE Restore command.
  • Parameter: commandValue: the value of command.It is 0xC2 + Mifare Block Addr + Data(16bytes).
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.

mifareTransfer(commandValue)

  • Function: Send MIFARE Transfer command.
  • Parameter: commandValue: the value of command.It is 0xB0.
  • Return:
    1. (True, ‘’) if the command is executed successfully.
    2. (False, error code) if failed to execute the command.
r502-api-manual.txt · Last modified: 2017/05/15 08:32 by Tarantino