|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.device.PiccManager
public class PiccManager
The PiccManager class is used to initialize and control RF Card reader.
To read RF Card with this class, use the following steps:
open()
to initialize the RF card reader.
request(byte[], byte[] )
.
antisel(byte[], byte[] )
.
#dactivate()
.
apduTransmit(byte[] , int , byte[] , byte[] )
.
#deactivate()
.
close()
.
For more information about the RF card reader, read the samples folder below PiccManager Demo.
Constructor Summary | |
---|---|
PiccManager()
|
Method Summary | |
---|---|
int |
activate()
activate card to start sending APDU。 |
int |
activateEx(byte[] art)
activate card to start sending APDU。 |
int |
antisel(byte[] sn,
byte[] sak)
anti-collision and select card and returns the serial number of the card |
int |
apduTransmit(byte[] sent,
int sentlen,
byte[] rsp)
Transmit APDU exchange commands:e.g. |
int |
apduTransmit(byte[] cmd,
int cmdlen,
byte[] rsp,
byte[] sw)
Transmit APDU commands |
int |
apduTransmit(byte[] cmd,
int cmdlen,
byte[] rsp,
int crc,
int speed)
Transmit APDU exchange commands:e.g. |
int |
apduTransmit(int cmd,
int num,
byte[] sent,
int sentlen,
byte[] rsp)
Transmit APDU commands for F Card |
int |
close()
Close the RF card reader |
int |
deactivate(byte mode)
Deavtivate a card |
int |
enableRATS(byte value)
enable RATS, |
int |
idcard_apduTransmit(byte[] sent,
int sentlen,
byte[] rsp)
Transmit APDU commands |
int |
idcard_init()
init the IDCARD |
int |
m1_amount(int blkNo)
read the amount for the block number |
int |
m1_decrement(int blkNO,
int iMoney)
decrement the value block by iMoney amount |
int |
m1_increment(int blkNo,
int iMoney)
increment the value block by iMoney amount |
int |
m1_init(int blkNo,
int value)
init the value block by value |
int |
m1_keyAuth(int keyType,
int blnNo,
int keylen,
byte[] keyBuf,
int iSeriNumlen,
byte[] seriNum)
authenticate a key |
int |
m1_readBlock(int blkNo,
byte[] pReadBuf)
To read a block |
int |
m1_restore(int blkNo)
Move the content of a block into temporary data register |
int |
m1_transfer(int blkNo)
transfer from temporary internal data register to value block |
int |
m1_writeBlock(int blkNo,
int iLenWriteBuf,
byte[] pWriteBuf)
Write a block into the card |
int |
open()
Open the RF card reader |
int |
primeCard_apduTransmit(byte[] sent,
int sentlen,
byte[] rsp)
Transmit APDU commands for type B.Note:This implement work on Android5.1 FW version 20180508 and later. |
int |
primeCard_init()
Init for TYPE B prime protocol.Note:This implement work on Android5.1 FW version 20180508 and later. |
int |
request_norats(byte[] mode,
byte[] atq)
Request card and no enable RATS |
int |
request_type(byte pollType,
byte[] mode,
byte[] atq)
Request Specify card type |
int |
request(byte[] mode,
byte[] atq)
Request card |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PiccManager()
Method Detail |
---|
public int open()
public int enableRATS(byte value)
public int primeCard_init()
public int primeCard_apduTransmit(byte[] sent, int sentlen, byte[] rsp)
sent
- APDU command to be sent, the command format with ISO7816 Transmission protocolsentlen
- APDU lengthrsp
- Response from card
public int request(byte[] mode, byte[] atq)
mode
- returns the card type, could be 'A' or 'B'atq
- returns the ATQ
public int request_norats(byte[] mode, byte[] atq)
mode
- returns the card type, could be 'A' or 'B'atq
- returns the ATQ
public int request_type(byte pollType, byte[] mode, byte[] atq)
pollType
- (bit0 A card,bit1 B card ,bit2 Felica-212 card,bit3 Felica-424 card ,bit4 15693 card,bit5 18000 card)mode
- returns the card type, A’ : A card,’B’ : B cardatq
- returns the ATQ
public int antisel(byte[] sn, byte[] sak)
sn
- serial numbersak
- SAK
public int activate()
public int activateEx(byte[] art)
[out]
- art buff
public int apduTransmit(byte[] cmd, int cmdlen, byte[] rsp, byte[] sw)
cmd
- APDU command to be sent, the command format with ISO7816 Transmission protocolcmdlen
- APDU lengthrsp
- Response from cardsw
- status bytes
public int apduTransmit(byte[] sent, int sentlen, byte[] rsp)
cmd
- APDU command to be sentcmdlen
- APDU lengthrsp
- Response from card
public int apduTransmit(byte[] cmd, int cmdlen, byte[] rsp, int crc, int speed)
cmd
- APDU command to be sentcmdlen
- APDU lengthrsp
- Response from cardcrc
- APDU CRCrsp
- APDU speed
public int deactivate(byte mode)
mode
- 0x00 imply HALT, deactivate card and return without checking for card removal.
0x01 imply REMOVE, deactivate card and check for card removal;
0x02 imply EMV compliant card removal, and check for card removal.
public int close()
public int m1_keyAuth(int keyType, int blnNo, int keylen, byte[] keyBuf, int iSeriNumlen, byte[] seriNum)
keyType
- key type: 0 means A key, 1 means B keyblnNo
- block numberkeylen
- key lengthkeyBuf
- the keyiSeriNumlen
- serial number lengthseriNum
- serial number
public int m1_readBlock(int blkNo, byte[] pReadBuf)
blkNo
- block numberpReadBuf
- to store the read data
public int m1_writeBlock(int blkNo, int iLenWriteBuf, byte[] pWriteBuf)
blkNo
- the block numberiLenWriteBuf
- length of buffer to be writtenpWriteBuf
- the buffer to be written
public int m1_increment(int blkNo, int iMoney)
blkNo
- the value block numberiMoney
- the amount to be decremented
public int m1_decrement(int blkNO, int iMoney)
blkNO
- the value block numberiMoney
- the amount to be decremented
public int m1_restore(int blkNo)
blkNo
- the block number to be operated on
public int m1_transfer(int blkNo)
blkNo
- the block number to be operated on
public int m1_init(int blkNo, int value)
blkNo
- the value block numbervalue
- the amount to be init
public int m1_amount(int blkNo)
blkNo
- the value block number
public int idcard_init()
public int idcard_apduTransmit(byte[] sent, int sentlen, byte[] rsp)
cmd
- APDU command to be sentcmdlen
- APDU lengthrsp
- Response from IDCard
public int apduTransmit(int cmd, int num, byte[] sent, int sentlen, byte[] rsp)
cmd
- num
- send
- APDU command to be sentsendlen
- APDU lengthrsp
- Response from F Card
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |