跳过导航链接
com.rscja.deviceapi

类 RFIDWithISO14443A

    • 方法概要

      所有方法 静态方法 实例方法 具体方法 已过时的方法 
      限定符和类型 方法和说明
      boolean DESFire_AddApp(java.lang.String hexAppId, int keySetting, int fileNums)
      Desfire卡 创建应用
      Desfire card, add app.
      boolean DESFire_AddStdFile(int fileNo, int commSet, char[] accessRight, int fileSize)
      Desfire卡 创建标准数据文件
      Desfire card. add standard data file
      boolean DESFire_AddValueFile(int fileNo, int commSet, char[] accessRights, int minValue, int maxValue, int initValue)
      Desfire卡 创建值文件
      Desfire card, add value file
      boolean DESFire_Auth(int keyNo, java.lang.String key)
      Desfire卡 验证密钥
      Desfire card key verification
      boolean DESFire_ChangeFileSetting(int fileNo, int commSet, char[] accessRights)
      Desfire卡 获取文件设置
      Desfire card, get file settings
      boolean DESFire_ChangeKey(int keyNo, java.lang.String newKey)
      Desfire卡 更改密钥
      Desfire card , change key
      boolean DESFire_ChangeKeySetting(int keySetting)
      Desfire卡 更改密钥设置
      Desfire card, change key settings
      boolean DESFire_CreditValueFile(int fileNo, int value)
      Desfire卡 充值函数
      Desfire card Credit value index
      boolean DESFire_DebitValueFile(int fileNo, int value)
      Desfire卡 扣费函数
      Desfure card, Debit index
      boolean DESFire_DelApp(java.lang.String hexAppId)
      Desfire卡 删除应用
      Desfire card , delete apps
      boolean DESFire_DelFile(int fileNo)
      Desfire卡 删除文件
      Desfire card. delete files
      boolean DESFire_FormatCard()
      Desfire卡 格式化卡片
      Desfire card, format card
      java.lang.String[] DESFire_GetApps()
      Desfire卡 获取所有应用
      Desfire card, get apps
      int[] DESFire_GetFileIds()
      Desfire卡 获取应用所有文件ID
      Desfire card, get all file IDs
      java.util.List<DESFireFile> DESFire_GetFiles()
      Desfire卡 获取应用所有文件
      Desfire card, get all app files.
      byte[] DESFire_GetFileSetting(int fileNo)
      Desfire卡 获取文件设置
      Desfire card , get file settings
      int[] DESFire_GetKeySetting()
      Desfire卡 获取密钥设置信息
      Desfire card, get key setting information
      java.lang.String[] DESFire_GetPiccInfo()
      Desfire卡 获取卡片信息
      Desfire card, get card info.
      boolean DESFire_RatsAndPss()
      Desfire卡 进入14443A协议的第4层,获取通讯参数
      Desfire card, Level 4 for ISO1443A,get communication parameter.
      char[] DESFire_ReadStdFile(int fileNo, int offSet, int dataSize)
      Desfire卡 读标准文件数据
      Desfire card, read standard file data
      int[] DESFire_ReadValueFile(int fileNo)
      Desfire卡 获取值文件内容
      Desfire card, read value file content
      boolean DESFire_SelApp(java.lang.String hexAppId)
      Desfire卡 选择应用
      Applcation selection
      void DESFire_selCpy(int cpyType)
      选择加密类型
      Encrytion type selection.
      boolean DESFire_WriteStdFile(int fileNo, int offSet, int dataSize, char[] dataBuf)
      Desfire卡 写标准文件数据
      Desfire card, write standard file data
      boolean free()
      释放rfid模块
      Release the RFID module
      static RFIDWithISO14443A getInstance()
      获取ISO14443A协议操作实例
      Get ISO1443A protocol instance.
      int getIntegerSomeBit(int resource, int mask)
      取整数的某一位
      Take a bit of an integer
      java.lang.String getVersion()
      已过时。 
      boolean init()
      初始化rfid模块
      Initialize RFID module
      boolean ISO14443A_decrement(int iBlockValue, int iBlockResult, int iValue) 
      boolean ISO14443A_increment(int iBlockValue, int iBlockResult, int iValue)
      电子钱包充值
      Increment
      boolean ISO14443A_initval(int iBlock, int iValue)
      电子钱包初始化
      Initialize the E-wallet.
      int[] ISO14443A_readval(int iBlock)
      读取电子钱包余额
      Read the value of E-wallet.
      boolean isPowerOn()
      判断设备是否上电
      Detect whether device is powered on or not.
      char[] M1_ReadData(int sector, int block)
      读取指定扇区指定block的数据,适用于S50和S70标签。
      SimpleRFIDEntity read(int block)
      读卡,适用于Urltra light标签
      Read cadr, used for Urltra light tags
      SimpleRFIDEntity read(java.lang.String key, RFIDWithISO14443A.KeyType keyType, int sector, int block)
      读卡,此函数包含寻卡和验证密钥步骤
      Read card,includes find card and key verification steps.
      SimpleRFIDEntity readAllData(java.lang.String key, RFIDWithISO14443A.TagType tagType)
      读卡,读取卡片所有块中的数据
      Read card. read all blocks data
      SimpleRFIDEntity request()
      寻卡
      Find card
      boolean rfidUpgrade(int packageCount, int index, int currSize, byte[] data)
      固件升级
      RFID firmware upgrade
      char[] sendBusCMD(char[] time, char[] uid, int uidnum, int flag)
      墨西哥公交命令
      Commands for Mexcico Bus.
      boolean VerifySector(int sector, java.lang.String key, RFIDWithISO14443A.KeyType keyType)
      验证扇区。
      boolean write(int block, java.lang.String hexData)
      写卡,适用于Urltra light标签
      Write card, used for Urltra light tag
      boolean write(java.lang.String key, RFIDWithISO14443A.KeyType keyType, int sector, int block, java.lang.String hexData)
      写卡,此函数包括寻卡和密钥验证异常
      Write card, includes find card and key verification failure exception
      • 从类继承的方法 java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • getInstance

        public static RFIDWithISO14443A getInstance()
                                             throws ConfigurationException
        获取ISO14443A协议操作实例
        Get ISO1443A protocol instance.
        返回:
        ISO14443A协议操作实例
        Return ISO1443A protocol instance.
        抛出:
        ConfigurationException - 配置错误异常
        Configuration failure exception
      • request

        public SimpleRFIDEntity request()
        寻卡
        Find card
        返回:
        成功则返回 SimpleRFIDEntity数据实体,失败则返回null
        If sucess, return SimpleRFIDEntity,if failure,then null
      • read

        public SimpleRFIDEntity read(java.lang.String key,
                                     RFIDWithISO14443A.KeyType keyType,
                                     int sector,
                                     int block)
                              throws RFIDVerificationException,
                                     RFIDReadFailureException
        读卡,此函数包含寻卡和验证密钥步骤
        Read card,includes find card and key verification steps.
        参数:
        key - 密钥
        Key
        keyType - 密钥类型
        Key type
        sector - 扇区
        Sector
        block - 块区
        Block
        返回:
        成功则返回 SimpleRFIDEntity数据实体,寻卡失败则返回null
        If sucess, return SimpleRFIDEntity, if failure, return null.
        抛出:
        RFIDVerificationException - 密钥验证失败异常
        Key verification failure exception
        RFIDReadFailureException - 读卡失败异常
        RFID read failure exception
      • read

        public SimpleRFIDEntity read(int block)
                              throws RFIDReadFailureException
        读卡,适用于Urltra light标签
        Read cadr, used for Urltra light tags
        参数:
        block -
        返回:
        成功则返回 SimpleRFIDEntity数据实体,寻卡失败则返回null
        If sucess then return SimpleRFIDEntity, if failure, return null
        抛出:
        RFIDReadFailureException - 读卡失败异常
        Read card failure.
      • write

        public boolean write(java.lang.String key,
                             RFIDWithISO14443A.KeyType keyType,
                             int sector,
                             int block,
                             java.lang.String hexData)
                      throws RFIDVerificationException,
                             RFIDNotFoundException
        写卡,此函数包括寻卡和密钥验证异常
        Write card, includes find card and key verification failure exception
        参数:
        key - 密钥
        Key
        keyType - 密钥类型
        Key type
        sector - 扇区
        Sector
        block - 块区
        Block
        hexData - 十六进制数据
        Hex data
        返回:
        true成功,false失败
        If sucess, return true, if failure, return false.
        抛出:
        RFIDVerificationException - 密钥验证失败异常
        RFID key verification failure exception.
        RFIDNotFoundException - 寻卡失败异常
        RFID card not found failure exception
      • write

        public boolean write(int block,
                             java.lang.String hexData)
                      throws RFIDNotFoundException
        写卡,适用于Urltra light标签
        Write card, used for Urltra light tag
        参数:
        block - 块区
        Block
        hexData - 十六进制数据
        Hex data
        返回:
        true成功,false失败
        If sucess, return true, if failure, return false.
        抛出:
        RFIDVerificationException - 密钥验证失败异常
        RFID key verification failure exception
        RFIDNotFoundException - 寻卡失败异常
        RFID card not found failure exception
      • VerifySector

        public boolean VerifySector(int sector,
                                    java.lang.String key,
                                    RFIDWithISO14443A.KeyType keyType)
        验证扇区。S50和S70标签需要使用到此函数。密钥验证通过才可对该扇区进行读写操作。
        Sector verification, used for S50 and S70 tag, read and write can process only after the key verification passed.
        参数:
        sector - S50标签扇区取值范围:0 ~ 15 ; S70标签扇区取值范围:0 ~ 39
        S50 sector range: 0-15; S70 sector range : 0-30.
        key - 密钥:12个十六进制数
        Key: 12 hexadecimal numbers
        keyType - 密钥类型
        Key type
        返回:
        true表示验证通过,false表示验证失败
        Return true for verification passed, false for failure.
      • M1_ReadData

        public char[] M1_ReadData(int sector,
                                  int block)
                           throws RFIDReadFailureException
        读取指定扇区指定block的数据,适用于S50和S70标签。使用此函数的时候,要确保该扇区密钥验证已通过。
        Read data in designated sector and block, used for S50 and S70 tag.Ensure the key verification for this block have been passed before use this index.
        参数:
        sector - 扇区
        Sector
        block - 数据块
        Block
        返回:
        返回读取的标签数据
        Return the tag data
        抛出:
        RFIDReadFailureException
      • DESFire_RatsAndPss

        public boolean DESFire_RatsAndPss()
        Desfire卡 进入14443A协议的第4层,获取通讯参数
        Desfire card, Level 4 for ISO1443A,get communication parameter.
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_GetKeySetting

        public int[] DESFire_GetKeySetting()
        Desfire卡 获取密钥设置信息
        Desfire card, get key setting information
        返回:
        返回null表示失败,[0]为密钥设置信息,[1]为密钥数量
        If failure , return null, [0] for key setting information, [1] for key quantity
      • DESFire_ChangeKeySetting

        public boolean DESFire_ChangeKeySetting(int keySetting)
        Desfire卡 更改密钥设置
        Desfire card, change key settings
        参数:
        keySetting - 密钥设置信息
        Key settings information
        返回:
        成功 true,失败 false If sucess,return true, if failure, return false.
      • getIntegerSomeBit

        public int getIntegerSomeBit(int resource,
                                     int mask)
        取整数的某一位
        Take a bit of an integer
        参数:
        resource - 要取某一位的整数
        Take an integer
        mask - 要取的位置索引,自右至左为0-7
        Position index,from right to left:0-7
        返回:
        返回某一位的值(0或者1)
        Return data value, 0 or 1.
      • DESFire_SelApp

        public boolean DESFire_SelApp(java.lang.String hexAppId)
        Desfire卡 选择应用
        Applcation selection
        参数:
        appId - 应用ID,十六进制字符串
        Application ID, HEX character string
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_Auth

        public boolean DESFire_Auth(int keyNo,
                                    java.lang.String key)
        Desfire卡 验证密钥
        Desfire card key verification
        参数:
        keyNo - 密钥号
        Key number
        key - 密钥
        Key
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_selCpy

        public void DESFire_selCpy(int cpyType)
        选择加密类型
        Encrytion type selection.
        参数:
        cpyType - 0x01(AES),0x02(DES)
      • DESFire_ChangeKey

        public boolean DESFire_ChangeKey(int keyNo,
                                         java.lang.String newKey)
        Desfire卡 更改密钥
        Desfire card , change key
        参数:
        keyNo - 密钥号
        Key number
        key - 密钥
        Key
        返回:
        成功 true,失败 false
        If sucess return true, if failure, return false.
      • DESFire_GetApps

        public java.lang.String[] DESFire_GetApps()
        Desfire卡 获取所有应用
        Desfire card, get apps
        返回:
        返回null表示失败,获取到的应用ID
        If failure , return nnull, App IDs got.
      • DESFire_DelApp

        public boolean DESFire_DelApp(java.lang.String hexAppId)
        Desfire卡 删除应用
        Desfire card , delete apps
        参数:
        appId - 应用ID,十六进制字符串
        Application ID, HEX character strings
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false
      • DESFire_FormatCard

        public boolean DESFire_FormatCard()
        Desfire卡 格式化卡片
        Desfire card, format card
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false
      • DESFire_GetPiccInfo

        public java.lang.String[] DESFire_GetPiccInfo()
        Desfire卡 获取卡片信息
        Desfire card, get card info.
        返回:
        返回null表示失败,获取Picc信息
        If failure, return null, get Picc information.
      • DESFire_AddApp

        public boolean DESFire_AddApp(java.lang.String hexAppId,
                                      int keySetting,
                                      int fileNums)
        Desfire卡 创建应用
        Desfire card, add app.
        参数:
        hexAppId - 应用ID,十六进制字符串
        APP ID, Hex character string
        keySetting - 密钥设置
        Key settings
        fileNums - 所包含的文件数 File numbers.
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_GetFileIds

        public int[] DESFire_GetFileIds()
        Desfire卡 获取应用所有文件ID
        Desfire card, get all file IDs
        返回:
        返回null表示失败,获取到的文件ID
        If failure, return null, get all file IDs.
      • DESFire_GetFiles

        public java.util.List<DESFireFile> DESFire_GetFiles()
        Desfire卡 获取应用所有文件
        Desfire card, get all app files.
        返回:
        获取到的文件ID,返回null表示失败
        Return file ID, return null if failure.
      • DESFire_GetFileSetting

        public byte[] DESFire_GetFileSetting(int fileNo)
        Desfire卡 获取文件设置
        Desfire card , get file settings
        参数:
        fileNo - 文件号
        File number
        返回:
        返回null表示失败
        If failure, return null
      • DESFire_ChangeFileSetting

        public boolean DESFire_ChangeFileSetting(int fileNo,
                                                 int commSet,
                                                 char[] accessRights)
        Desfire卡 获取文件设置
        Desfire card, get file settings
        参数:
        fileNo - 文件号
        File number
        commSet - 通讯设置
        Communication settings
        accessRights - 存取权限
        Acess rights
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_DelFile

        public boolean DESFire_DelFile(int fileNo)
        Desfire卡 删除文件
        Desfire card. delete files
        参数:
        fileNo - 文件号
        File numbers
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_AddStdFile

        public boolean DESFire_AddStdFile(int fileNo,
                                          int commSet,
                                          char[] accessRight,
                                          int fileSize)
        Desfire卡 创建标准数据文件
        Desfire card. add standard data file
        参数:
        fileNo - 文件号
        File number
        commSet - 通讯设置
        Communication settings
        accessRight - 存取权限
        Acess right
        fileSize - 文件大小
        File Size
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_WriteStdFile

        public boolean DESFire_WriteStdFile(int fileNo,
                                            int offSet,
                                            int dataSize,
                                            char[] dataBuf)
        Desfire卡 写标准文件数据
        Desfire card, write standard file data
        参数:
        fileNo - 文件号
        file number
        offSet - 起始位置偏移量
        Start address offset value
        dataSize - 数据大小
        Data Size
        dataBuf - 数据,1~200个字节
        Data, 1-200 bytes
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_ReadStdFile

        public char[] DESFire_ReadStdFile(int fileNo,
                                          int offSet,
                                          int dataSize)
        Desfire卡 读标准文件数据
        Desfire card, read standard file data
        参数:
        fileNo - 文件号
        File number
        offSet - 起始位置偏移量
        Start address offset value
        dataSize - 数据大小 Data size
        返回:
        返回null表示失败
        If failure, return null.
      • DESFire_AddValueFile

        public boolean DESFire_AddValueFile(int fileNo,
                                            int commSet,
                                            char[] accessRights,
                                            int minValue,
                                            int maxValue,
                                            int initValue)
        Desfire卡 创建值文件
        Desfire card, add value file
        参数:
        fileNo - 文件号
        File number
        commSet - 通讯设置
        Communication settings
        accessRights - 存取权限
        Acess rights
        minValue - 最小值
        Minmum value
        maxValue - 最大值
        Max Value
        initValue - 初始值
        Initialize Value
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_ReadValueFile

        public int[] DESFire_ReadValueFile(int fileNo)
        Desfire卡 获取值文件内容
        Desfire card, read value file content
        参数:
        fileNo - 文件号
        File number
        返回:
        返回null表示失败
        If failure, return null.
      • DESFire_CreditValueFile

        public boolean DESFire_CreditValueFile(int fileNo,
                                               int value)
        Desfire卡 充值函数
        Desfire card Credit value index
        参数:
        fileNo - 文件号
        File number
        value - 充入的值
        Value
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • DESFire_DebitValueFile

        public boolean DESFire_DebitValueFile(int fileNo,
                                              int value)
        Desfire卡 扣费函数
        Desfure card, Debit index
        参数:
        fileNo - 文件号
        File number
        value - 扣除的值
        Debit value
        返回:
        成功 true,失败 false
        If sucess, return true, if failure, return false.
      • ISO14443A_increment

        public boolean ISO14443A_increment(int iBlockValue,
                                           int iBlockResult,
                                           int iValue)
        电子钱包充值
        Increment
        参数:
        iBlockValue - 当前金额所在块
        The block that money belongs to.
        iBlockResult - 充值后剩余金额保存的块
        The block that store the availiable money.
        iValue - 金额
        Money value
        返回:
        返回值:0为成功,非0为失败
        If sucess, return 0,return else if failure.
      • ISO14443A_decrement

        public boolean ISO14443A_decrement(int iBlockValue,
                                           int iBlockResult,
                                           int iValue)
      • ISO14443A_initval

        public boolean ISO14443A_initval(int iBlock,
                                         int iValue)
        电子钱包初始化
        Initialize the E-wallet.
        参数:
        iBlock - 要写入数据的绝对块号 块号范围 0~632)
        The block that need to write data ,block number range: 0-632.
        iValue - 初始金额
        Initialize the value.
        返回:
        返回值:0为成功,非0为失败状态码
        Return 0 if sucess, return else if failure.
      • ISO14443A_readval

        public int[] ISO14443A_readval(int iBlock)
        读取电子钱包余额
        Read the value of E-wallet.
        参数:
        iBlock - 要读取数据的绝对块号 块号范围 0~63
        The block to be read, block number range: 0-63
        返回:
        (第0个元素是状态位,0表示成功,非零为错误码,如果为错误码,后面无数据 )第1个元素是读取到的余额
        Return , the 0 element for status, 0 for sucess, else for failure,if failure,then no data for the next element, 1 element for the value of the money that been read.
      • sendBusCMD

        public char[] sendBusCMD(char[] time,
                                 char[] uid,
                                 int uidnum,
                                 int flag)
        墨西哥公交命令
        Commands for Mexcico Bus.
        参数:
        time - 时分秒,3字节
        Time
        uid - 卡号缓存
        UID
        uidnum - 卡号 数量
        UID number and quantity
        flag - 0:无上下车信息, 1: 上车 ,2 :下车
        0, no on board and off board information, 1: on board, 2 : off board.
        返回:
        第一字节: 0:成功, 其他失败; 第二字节:长度, 后续数据长度; 第三字节: 0:无上下车信息, 1: 上车 ,2 :下车; 第四字节---:为卡金信息(4字节卡号+2字节金额)的数据集 ,长度为 第二字节减一
        Return data, first byte 0 for sucess, other for failure. Second byte, length, data length Third byte, 0, no on board and off board information, 1: on board, 2 : off board. Fourth byte, card money information (4 bytes of card number+2byte money ), length is second byte minus 1.
      • init

        public boolean init()
        初始化rfid模块
        Initialize RFID module
        返回:
        true成功,false失败
        If sucess, then return true, if failure, return false
      • free

        public boolean free()
        释放rfid模块
        Release the RFID module
        返回:
        true成功,false失败
        If sucess, then return true, if failure, return false
      • getVersion

        @Deprecated
        public java.lang.String getVersion()
        已过时。 
        获取rfid 版本信息
        Get RFID version information.
        返回:
        返回版本信息,null为失败
        Return RFID version infor, if failure, return null.
      • rfidUpgrade

        public boolean rfidUpgrade(int packageCount,
                                   int index,
                                   int currSize,
                                   byte[] data)
        固件升级
        RFID firmware upgrade
        参数:
        packageCount - 包的数量
        Package count.
        index - 当前为第几个包
        Current package count nnumber.
        currSize - 当前包大小
        Current package size.
        data - 包数据
        Package data.
        返回:
        true成功,false失败
        If sucess, return true, if failure, return false.
      • isPowerOn

        public boolean isPowerOn()
        判断设备是否上电
        Detect whether device is powered on or not.
        返回:
        已经上电返回true,反之返回false
        If powered on,return true, if not, return false.