com.pax.dal
Interface IIcc
-
public interface IIcc
关于 POS IC卡的API。 如果开启权限检查,需在AndroidManifest下添加权限:"com.pax.permission.ICC"API for POS IC cards. If permission check is enabled, you need to add permission under AndroidManifest: "com.pax.permission.ICC".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidautoResp(byte slot, boolean isAutoResp)设置isoCommand函数是否自动发送GET RESPONSE指令Configure IsoCommand method to decide whether sends 'Get Response command automatically or not.voidclose(byte slot)对指定卡座中的卡片下电Power off the specified IC card in the card slotbyte[]cmdExchange(byte slot, byte[] dataIn)与卡片进行APDU数据交互,终端将dataIn中的数据直接发送给卡片,并接收卡片的应答数据。Perform APDU data interaction with the card.booleandetect(byte slot)检查指定的卡座内是否有卡,对于0-1卡座使用到位检测。对于2-5卡座做上电复位检测Check whether card is inserted in specified slot.ICardAT24CxxgetCardAT24Cxx()获取ICardAT24Cxxget interface ICardAT24CxxICardAT88SC102getCardAT88SC102()获取ICardAT88SC102get interface ICardAT88SC102ICardAT88SC153getCardAT88SC153()获取ICardAT88SC153get interface ICardAT88SC153ICardAT88SC1608getCardAT88SC1608()获取ICardAT88SC1608get interface ICardAT88SC1608ICardSle4428getCardSle4428()获取ICardSle4428get interface ICardSle4428ICardSle4442getCardSle4442()获取ICardSle4442get interface ICardSle4442voidiccEnableAutoLockCard(boolean enable)开启/关闭自动锁IC卡功能Enable/Disable the automatic IC card lock functionbooleaniccIsCardLocked()判断IC卡是否锁住Determine whether the IC card is lockedvoidiccLockCard()锁IC卡Lock IC cardvoidiccUnlockCard()解锁IC卡Unlock IC cardbyte[]init(byte slot)复位IC卡片,并返回卡片的复位应答内容Reset IC card and return the content of answer to resetbyte[]isoCommand(byte slot, byte[] apduSend)IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)IC card operation function.ApduRespInfoisoCommandByApdu(byte slot, ApduSendInfo apduSendInfo)IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)IC card operation function.voidlight(boolean onOff)IC卡插卡亮灯控制Light controller of inserted IC card.IccParareadParam(byte slot)读取IC读卡器参数。Read IC card reader parameters.voidsetParam(byte slot, IccPara para)设置IC读卡器参数。Set IC card reader parameters.
-
-
-
Method Detail
-
init
byte[] init(byte slot) throws IccDevException
复位IC卡片,并返回卡片的复位应答内容Reset IC card and return the content of answer to reset- Parameters:
slot-需要初始化卡通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
- Returns:
- 卡片复位应答 内容。Answer to reset of card.
- Throws:
IccDevException
-
close
void close(byte slot) throws IccDevException
对指定卡座中的卡片下电Power off the specified IC card in the card slot- Parameters:
slot-通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
- Throws:
IccDevException
-
autoResp
void autoResp(byte slot, boolean isAutoResp) throws IccDevException
设置isoCommand函数是否自动发送GET RESPONSE指令Configure IsoCommand method to decide whether sends 'Get Response command automatically or not.- Parameters:
slot-通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
isAutoResp-- true:自动发送
- false:不自动发送
- true -- send automatically
- false -- does not send automatically
- Throws:
IccDevException
-
isoCommand
byte[] isoCommand(byte slot, byte[] apduSend) throws IccDevException
IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)IC card operation function. This function supports IC card universal interface protocol (T=0 and T=1).- Parameters:
slot-通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
apduSend-发送的IC卡命令数据- byte Command[4];// Command[] = {CLA,INS,P1,P2}
- short Lc;//Lc = DataIn 的长度。
- byte DataIn[512];//DataIn = 要发送到 IC 卡的数据。
- short Le;//Le = 期望返回数据的长度,实际返回数据长度卡片返回与具体命令有关,这里只是期望长度,实际的返回长度可由响应结构参数的 LenOut 获得。
-Data structure of command send to IC card.- byte Command[4]; // Command[] : {CLA,INS,P1,P2}
- short Lc; // Lc : DataIn length.
- byte DataIn[512]; // DataIn : Data to be sent to IC card
- short Le; // Le : Expected length for the returns data
- Returns:
- IC卡返回的命令数据{DataOut,SWA,SWB}data structure received from IC card. {DataOut,SWA,SWB}
- Throws:
IccDevException
-
detect
boolean detect(byte slot) throws IccDevException
检查指定的卡座内是否有卡,对于0-1卡座使用到位检测。对于2-5卡座做上电复位检测Check whether card is inserted in specified slot. In-place check will take place for No.0-1 slots. Power-on and resetting will take place for No. 2-5 slots.- Parameters:
slot-通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
- Returns:
- true:有卡插入
- false:没有卡插入
- true:Card-inserted
- false:No card
- Throws:
IccDevException
-
light
void light(boolean onOff) throws IccDevException
IC卡插卡亮灯控制Light controller of inserted IC card.- Parameters:
onOff-- true:亮灯
- false:灭灯
- true -- Light's on
- false -- Light's off
- Throws:
IccDevException
-
isoCommandByApdu
ApduRespInfo isoCommandByApdu(byte slot, ApduSendInfo apduSendInfo) throws IccDevException
IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)IC card operation function. This function supports IC card universal interface protocol (T=0 and T=1).- Parameters:
slot-通道号- bit[2:0]:0~7 编号的通道号
- bit[4:3]:表示操作条件 00:5V 01:1.8V 10:3V 11:5V
- bit[5]:表示对 PPS 协议支持 0 表示不支持1 表示支持
- bit[6]:表示上电复位使用速率0 默认(9600)1 38400
- bit[7]:表示支持的规范类型0 EMV1 ISO7816-3
the number of card channel which should be initialized- bit[2:0] : the number of card channel 0:bank card channel 2:SAM1 card channel 3:SAM2 card channel 4:SAM3 card channel 5:SAM4 card channel
- bit[4:3] : Operating conditions00:5V 01:1.8V 10:3V 11:5V
- bit[5] :Whether to support the PPS protocol0:false1:true
- bit[6] :use velocity for power on reset0:9600(default)1:38400
- bit[7] :Whether to support the specification type0:EMV1:ISO7816-3
apduSendInfo-- command -CLA, INS, P1, P2.
- dataIn -发送给ICC的数据
- lc -发送的数据的长度
- le -期望接收到的数据长度
ApduSendInfo
Note: set apduSendInfo.le value to 256 to make LE 0 in the command(i.e. expect response data as much as possible) ; setting apduSendInfo.le value to 0 means no response data expected.- Returns:
- ICC返回的数据
- dataOut -从ICC返回的数据
- lenOut -返回的数据的长度
- swA -ICC 状态1
- swB -ICC 状态2
Receiving data structure of ICC,ApduSendInfo - Throws:
IccDevException
-
getCardAT24Cxx
ICardAT24Cxx getCardAT24Cxx()
获取ICardAT24Cxxget interface ICardAT24Cxx- Returns:
ICardAT24Cxx- Since:
- V2.00.01
-
getCardAT88SC102
ICardAT88SC102 getCardAT88SC102()
获取ICardAT88SC102get interface ICardAT88SC102- Returns:
ICardAT88SC102- Since:
- V2.00.01
-
getCardAT88SC153
ICardAT88SC153 getCardAT88SC153()
获取ICardAT88SC153get interface ICardAT88SC153- Returns:
ICardAT88SC153- Since:
- V2.00.01
-
getCardSle4428
ICardSle4428 getCardSle4428()
获取ICardSle4428get interface ICardSle4428- Returns:
ICardSle4428- Since:
- V2.00.01
-
getCardAT88SC1608
ICardAT88SC1608 getCardAT88SC1608()
获取ICardAT88SC1608get interface ICardAT88SC1608- Returns:
ICardAT88SC1608- Since:
- V2.00.01
-
getCardSle4442
ICardSle4442 getCardSle4442()
获取ICardSle4442get interface ICardSle4442- Returns:
ICardSle4442- Since:
- V2.00.01
-
readParam
IccPara readParam(byte slot) throws IccDevException
读取IC读卡器参数。Read IC card reader parameters.- Parameters:
slot-卡通道号。The number of card channel.- Returns:
IccPara- Throws:
IccDevException- Since:
- V3.10.00
-
setParam
void setParam(byte slot, IccPara para) throws IccDevException
设置IC读卡器参数。Set IC card reader parameters.- Parameters:
slot-卡通道号。The number of card channel.para-IccPara- Throws:
IccDevException- Since:
- V3.10.00
-
cmdExchange
byte[] cmdExchange(byte slot, byte[] dataIn) throws IccDevException
与卡片进行APDU数据交互,终端将dataIn中的数据直接发送给卡片,并接收卡片的应答数据。Perform APDU data interaction with the card. The terminal sends the data in dataIn directly to the card and receives the response data from the card.- Parameters:
slot-需要复位的卡通道号。- bit[2:0]: 0~7编号的通道号。
- bit[4:3]: 操作条件。
- 00: 5V
- 01: 1.8V
- 10: 3V
- 11: 5V
- bit[5]: 对 PPS 协议是否支持。
- 0: 不支持。
- 1:支持。
- bit[6]: 上电复位使用速率。
- 0: 默认,9600。
- 1: 38400。
- bit[7]: 支持的规范类型。
- 0: EMV。
- 1: ISO7816-3。
The channel number of the card to be reset.- bit[2:0]: Channel number numbered 0~7.
- bit[4:3]: Operating conditions.
- 00: 5V
- 01: 1.8V
- 10: 3V
- 11: 5V
- bit[5]: Whether to support the PPS protocol.
- 0: Not support.
- 1:Support.
- bit[6]: Power-on reset usage rate.
- 0: Default, 9600.
- 1: 38400.
- bit[7]: Supported specification types.
- 0: EMV.
- 1: ISO7816-3.
dataIn-待发送的命令数据。The command data to be sent.- Returns:
- 接收到的卡片数据。Data received from the card.
- Throws:
IccDevException- IccDevException- Since:
- V3.25.00
-
iccLockCard
void iccLockCard() throws IccDevException
锁IC卡Lock IC card- Throws:
IccDevException
-
iccUnlockCard
void iccUnlockCard() throws IccDevException
解锁IC卡Unlock IC card- Throws:
IccDevException
-
iccEnableAutoLockCard
void iccEnableAutoLockCard(boolean enable) throws IccDevException
开启/关闭自动锁IC卡功能Enable/Disable the automatic IC card lock function- Parameters:
enable-true: 开启, flase: 关闭true: Enable, flase: Disable- Throws:
IccDevException
-
iccIsCardLocked
boolean iccIsCardLocked() throws IccDevException
判断IC卡是否锁住Determine whether the IC card is locked- Returns:
- true: 已锁, flase: 未锁true: Lock, flase: Unlock
- Throws:
IccDevException
-
-