Rokato-JNI 2.4.1
蓉卡通安卓接口库
载入中...
搜索中...
未找到
com.Rokato.jni.utils.UsbUtils类 参考

interface  IUsbFind
 

Public 成员函数

 UsbUtils (Context ctx, IUsbFind usbFind)
 
UsbDevice find (int VID, int PID)
 
UsbDevice findReader (short devType)
 
boolean hasDevice (UsbDevice dev)
 
boolean hasReader (short devType)
 
UsbDeviceConnection open (UsbDevice dev)
 

静态 Public 成员函数

static UsbDevice findReader (HashMap< String, UsbDevice > deviceList, short devType)
 

详细描述

安卓USB设备管理类

构造及析构函数说明

◆ UsbUtils()

com.Rokato.jni.utils.UsbUtils.UsbUtils ( Context  ctx,
IUsbFind  usbFind 
)

构造USB管理对象

参数
ctx建议传全局的 getApplicationContext()
usbFind如果不需要自定义控制具体使用的USB设备则传null

成员函数说明

◆ findReader() [1/2]

static UsbDevice com.Rokato.jni.utils.UsbUtils.findReader ( HashMap< String, UsbDevice >  deviceList,
short  devType 
)
static

从设备列表中查找读卡器设备

参数
deviceList待查找的设备列表
devType参考 RfReader.DevType_
返回
返回找到的读卡器设备对象 不存在返回null

◆ find()

UsbDevice com.Rokato.jni.utils.UsbUtils.find ( int  VID,
int  PID 
)

根据VID:PID查找设备

返回
返回找到的设备对象 不存在返回null

◆ findReader() [2/2]

UsbDevice com.Rokato.jni.utils.UsbUtils.findReader ( short  devType)

自动查找读卡器设备

参数
devType参考 RfReader.DevType_
返回
返回找到的读卡器设备对象 不存在返回null

◆ hasDevice()

boolean com.Rokato.jni.utils.UsbUtils.hasDevice ( UsbDevice  dev)

检查设备对象是否不为空并且权限可用

参数
dev需要检查的设备对象

◆ hasReader()

boolean com.Rokato.jni.utils.UsbUtils.hasReader ( short  devType)

检查内部读卡器设备是否可用

参数
devType参考 RfReader.DevType_

◆ open()

UsbDeviceConnection com.Rokato.jni.utils.UsbUtils.open ( UsbDevice  dev)

打开设备

参数
dev需打开的设备
返回
失败返回null

该类的文档由以下文件生成: