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
      void autoResp(byte slot, boolean isAutoResp)
      设置isoCommand函数是否自动发送GET RESPONSE指令
      Configure IsoCommand method to decide whether sends 'Get Response command automatically or not.
      void close(byte slot)
      对指定卡座中的卡片下电
      Power off the specified IC card in the card slot
      byte[] cmdExchange(byte slot, byte[] dataIn)
      与卡片进行APDU数据交互,终端将dataIn中的数据直接发送给卡片,并接收卡片的应答数据。
      Perform APDU data interaction with the card.
      boolean detect(byte slot)
      检查指定的卡座内是否有卡,对于0-1卡座使用到位检测。对于2-5卡座做上电复位检测
      Check whether card is inserted in specified slot.
      ICardAT24Cxx getCardAT24Cxx()
      获取ICardAT24Cxx
      get interface ICardAT24Cxx
      ICardAT88SC102 getCardAT88SC102()
      获取ICardAT88SC102
      get interface ICardAT88SC102
      ICardAT88SC153 getCardAT88SC153()
      获取ICardAT88SC153
      get interface ICardAT88SC153
      ICardAT88SC1608 getCardAT88SC1608()
      获取ICardAT88SC1608
      get interface ICardAT88SC1608
      ICardSle4428 getCardSle4428()
      获取ICardSle4428
      get interface ICardSle4428
      ICardSle4442 getCardSle4442()
      获取ICardSle4442
      get interface ICardSle4442
      void iccEnableAutoLockCard(boolean enable)
      开启/关闭自动锁IC卡功能
      Enable/Disable the automatic IC card lock function
      boolean iccIsCardLocked()
      判断IC卡是否锁住
      Determine whether the IC card is locked
      void iccLockCard()
      锁IC卡
      Lock IC card
      void iccUnlockCard()
      解锁IC卡
      Unlock IC card
      byte[] init(byte slot)
      复位IC卡片,并返回卡片的复位应答内容
      Reset IC card and return the content of answer to reset
      byte[] isoCommand(byte slot, byte[] apduSend)
      IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)
      IC card operation function.
      ApduRespInfo isoCommandByApdu(byte slot, ApduSendInfo apduSendInfo)
      IC卡操作函数。该函数支持IC卡通用接口协议(T=0及T=1)
      IC card operation function.
      void light(boolean onOff)
      IC卡插卡亮灯控制
      Light controller of inserted IC card.
      IccPara readParam(byte slot)
      读取IC读卡器参数。
      Read IC card reader parameters.
      void setParam(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 -期望接收到的数据长度
        注意:底层通过传入le的值为256的方式来表示发送给卡片的APDU le为0,而传入le为0表示APDU不包含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
      • 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
      • 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