Site Tools


r502-api-manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
r502-api-manual [2017/05/11 03:24]
jinbiao
r502-api-manual [2017/05/15 08:32] (current)
Tarantino
Line 1: Line 1:
  ​====== R502 Spy Library 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.  +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 [[https:/​mailto:​javacardos@gmail.com|javacardos@gmail.com]] .+For any question, please contact [[https:/​mailto:​javacardos@gmail.com|javacardos@gmail.com]] .
  
  
Line 8: Line 8:
 ==== 1. Constructor and initialization ==== ==== 1. Constructor and initialization ====
 === Constructor === === Constructor ===
- 
  
   * Parameter: scinterface   * Parameter: scinterface
Line 15: Line 14:
    
 === init() === === init() ===
- 
  
   * Function: Initialization.   * Function: Initialization.
    
- 
   * Parameter: Null.   * Parameter: Null.
    
   * Return: Null.   * Return: Null.
    
- 
 ====2. Related contactless API==== ====2. Related contactless API====
 === rfOn() === === rfOn() ===
- 
  
   * Function: Open smartcard reader electromagnetic field.   * Function: Open smartcard reader electromagnetic field.
-  
- 
  
   * Parameter: Null.   * Parameter: Null.
    
- 
   * Return:   * Return:
-        - True if the command is executed successfully.  +        ​- True if the command is executed successfully.  
-        - False if failed to execute the command. +        - False if failed to execute the command.
-\\ +
  
 === rfOff() === === rfOff() ===
- 
  
   * Function: Close smartcard reader electromagnetic field.   * Function: Close smartcard reader electromagnetic field.
Line 48: Line 38:
   * Parameter: Null.   * Parameter: Null.
    
- 
   * Return:   * Return:
-        - True if the command is executed successfully.  +        ​- True if the command is executed successfully.  
-        - False if failed to execute the command.+        - False if failed to execute the command.
    
- 
 === rfAuto() === === rfAuto() ===
- 
  
   * Function: Set smartcard reader debug function to automatic status. In this status, anti-collision will be completed automatically.   * Function: Set smartcard reader debug function to automatic status. In this status, anti-collision will be completed automatically.
    
- 
   * Parameter: Null.   * Parameter: Null.
    
   * Return:   * Return:
-        - True if the command is executed successfully.  +        ​- True if the command is executed successfully.  
-        - False if failed to execute the command. +        - False if failed to execute the command.
-\\ +
  
 === rfManaul() === === rfManaul() ===
- 
  
   * Function: Set smartcard reader debug function to manual operation status. In this status, anti-collision program will be implemented by calling API interface.   * 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.   * Parameter: Null.
    
- 
   * Return:   * Return:
-        - True if the command is executed successfully.  +        ​- True if the command is executed successfully.  
-        - False if failed to execute the command.+        - False if failed to execute the command.
    
 ====3. ISO14443 TypeA protocol API==== ====3. ISO14443 TypeA protocol API====
 === claREQA(commandValue) === === claREQA(commandValue) ===
- 
  
   * Function: Send REQA command of ISO14443 TypeA.   * Function: Send REQA command of ISO14443 TypeA.
    
- 
   * Parameter: commandValue:​ the value of command. It is 0x26 as defined in ISO14443 specification.   * Parameter: commandValue:​ the value of command. It is 0x26 as defined in ISO14443 specification.
-  
- 
  
   * Return:   * Return:
-        - (True, command response value: ATQA) if the command is executed successfully.  +        ​- (True, command response value: ATQA) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claWUPA(commandValue) === === claWUPA(commandValue) ===
- 
  
   * Function: Send WUPA command of ISO14443 TypeA.   * Function: Send WUPA command of ISO14443 TypeA.
    
- 
   * Parameter: commandValue:​ the value of command. It is 0x52 as defined in ISO14443 specification.   * Parameter: commandValue:​ the value of command. It is 0x52 as defined in ISO14443 specification.
    
- 
   * Return:   * Return:
-        - (True, command response value: ATQA) if the command is executed successfully.  +        ​- (True, command response value: ATQA) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claAnticollision(commandValue) === === claAnticollision(commandValue) ===
- 
  
   * Function: Send ANTICOLLISION command of ISO14443 TypeA.   * Function: Send ANTICOLLISION command of ISO14443 TypeA.
-  
  
-  * Parameter: commandValue:​ the value of command. e.g.: â€˜93 20’‘95 20’‘97 20’.+  * Parameter: commandValue:​ the value of command. e.g.: e.g.: ‘93 20’95 20’97 20’.
    
- 
   * Return:   * Return:
-        - (True, command response value: UID CLn) if the command is executed successfully.  +        ​- (True, command response value: UID CLn) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claSelect(commandValue) === === claSelect(commandValue) ===
- 
  
   * Function: Send SELECT command of ISO14443 TypeA.   * Function: Send SELECT command of ISO14443 TypeA.
-  
  
-  * Parameter: commandValue:​ the value of command. e.g.: â€˜93 70’ ​+ UID, â€˜95 70’ ​+ UID, â€˜97 70’ ​+ UID.+  * Parameter: commandValue:​ the value of command. e.g.:  ‘93 70’ + UID, 95 70’ + UID, 97 70’ + UID.
    
- 
   * Return:   * Return:
-        - (True, command response value: SAK) if the command is executed successfully.  +        ​- (True, command response value: SAK) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claRATS(commandValue) === === claRATS(commandValue) ===
Line 139: Line 108:
   * Function: Send RATScommand of ISO14443 TypeA.   * 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.
-  ​* Parameter: commandValue:​ the value of command. The format defined in specification: ​‘E0’ ​+ Parameter byte.+
    
   * Return:   * Return:
-        - (True, command response value: ATS) if the command is executed successfully.  +        ​- (True, command response value: ATS) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claHLTA(commandValue) === === claHLTA(commandValue) ===
- 
  
   * Function:​Send HLTA command of ISO14443 TypeA.   * Function:​Send HLTA command of ISO14443 TypeA.
-  
  
-  * Parameter: commandValue:​ the value of command. The format defined in specification: ​‘50 00’. +  * Parameter: commandValue:​ the value of command. The format defined in specification: ​50 00’.
- +
  
   * Return:   * Return:
-        - (True, command response value) if the command is executed successfully.  +        ​- (True, command response value) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === claPPS(commandValue) === === claPPS(commandValue) ===
- 
  
   * Function:​Send PPS command of ISO14443 TypeA.   * Function:​Send PPS command of ISO14443 TypeA.
-  
  
   * Parameter: commandValue:​ the value of command. The format defined in specification:​ PPSS + PPS0 + PPS1.   * Parameter: commandValue:​ the value of command. The format defined in specification:​ PPSS + PPS0 + PPS1.
    
   * Return:   * Return:
-        - (True, command response value) if the command is executed successfully.  +        ​- (True, command response value) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 ====4. ISO14443 Block protocol API==== ====4. ISO14443 Block protocol API====
 === clTransmit(commandValue) === === clTransmit(commandValue) ===
- 
  
   * Function: Send ISO14443 block.   * Function: Send ISO14443 block.
    
- 
   * Parameter: commandValue:​ the value of command. It can be I-Block, R-Block or S-Block.   * Parameter: commandValue:​ the value of command. It can be I-Block, R-Block or S-Block.
    
   * Return:   * Return:
-        - (True, block response value) if the command is executed successfully.  +        ​- (True, block response value) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
  
 ====5. MIFARE Command API==== ====5. MIFARE Command API====
 === mifareAuthentication(commandValue) === === mifareAuthentication(commandValue) ===
- 
  
   * Function: Send MIFARE Authentication command.   * Function: Send MIFARE Authentication command.
    
- +  ​* Parameter: commandValue: ​ the value of command.Auth type + Mifare Block Addr + (authentication key(6 bytes) + UID).
-  ​* Parameter: commandValue:​ the value of command.Auth type + Mifare Block Addr + (authentication key(6 bytes) + UID).+
    
- 
- 
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command.+        - (False, error code) if failed to execute the command.
    
 === mifareBlockRead(commandValue) === === mifareBlockRead(commandValue) ===
- 
  
   * Function: Send MIFARE Read command.   * Function: Send MIFARE Read command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0x30 + Mifare Block Addr. 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command.It is 0x30 + Mifare Block Addr.
  
   * Return:   * Return:
-        - (True, block data) if the command is executed successfully.  +        ​- (True, block data) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
 === mifareBlockWrite(commandValue) === === mifareBlockWrite(commandValue) ===
- 
  
   * Function: Send MIFARE Write command.   * Function: Send MIFARE Write command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0xA0 + Mifare Block Addr + Data(16bytes). 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command It is 0xA0 + Mifare Block Addr + Data(16bytes).
  
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
 === mifareIncrement(commandValue) === === mifareIncrement(commandValue) ===
- 
  
   * Function: Send MIFARE Increment command.   * Function: Send MIFARE Increment command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0xC1 + Mifare Block Addr + Data(16 bytes). 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command.It is 0xC1 + Mifare Block Addr + Data(16 bytes).
  
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
 === mifareDecrement(commandValue) === === mifareDecrement(commandValue) ===
- 
  
   * Function: Send MIFARE Decrement command.   * Function: Send MIFARE Decrement command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0xC0 + Mifare Block Addr + Data(16bytes). 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command.It is 0xC0 + Mifare Block Addr + Data(16bytes).
  
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
 === mifareRestore (commandValue) === === mifareRestore (commandValue) ===
- 
  
    ​* ​ Function: Send MIFARE Restore command.    ​* ​ Function: Send MIFARE Restore command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0xC2 + Mifare Block Addr + Data(16bytes). 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command.It is 0xC2 + Mifare Block Addr + Data(16bytes).
  
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
 === mifareTransfer(commandValue) === === mifareTransfer(commandValue) ===
- 
  
   * Function: Send MIFARE Transfer command.   * Function: Send MIFARE Transfer command.
-\\  
- 
- 
- 
-  * Parameter: commandValue:​ the value of command.It is 0xB0. 
-\\  
- 
  
 +  * Parameter: commandValue:​ the value of command.It is 0xB0.
  
   * Return:   * Return:
-        - (True, ​‘’) if the command is executed successfully.  +        ​- (True, ​‘’) if the command is executed successfully.  
-        - (False, error code) if failed to execute the command. +        - (False, error code) if failed to execute the command.
-\\ +
  
  
r502-api-manual.1494473099.txt.gz · Last modified: 2017/05/13 02:26 (external edit)