![]() |
Rokato-JNI 2.4.1
蓉卡通安卓接口库
|
类 | |
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设备管理类
com.Rokato.jni.utils.UsbUtils.UsbUtils | ( | Context | ctx, |
IUsbFind | usbFind | ||
) |
构造USB管理对象
ctx | 建议传全局的 getApplicationContext() |
usbFind | 如果不需要自定义控制具体使用的USB设备则传null |
|
static |
从设备列表中查找读卡器设备
deviceList | 待查找的设备列表 |
devType | 参考 RfReader.DevType_ |
UsbDevice com.Rokato.jni.utils.UsbUtils.find | ( | int | VID, |
int | PID | ||
) |
根据VID:PID查找设备
UsbDevice com.Rokato.jni.utils.UsbUtils.findReader | ( | short | devType | ) |
自动查找读卡器设备
devType | 参考 RfReader.DevType_ |
boolean com.Rokato.jni.utils.UsbUtils.hasDevice | ( | UsbDevice | dev | ) |
检查设备对象是否不为空并且权限可用
dev | 需要检查的设备对象 |
boolean com.Rokato.jni.utils.UsbUtils.hasReader | ( | short | devType | ) |
检查内部读卡器设备是否可用
devType | 参考 RfReader.DevType_ |
UsbDeviceConnection com.Rokato.jni.utils.UsbUtils.open | ( | UsbDevice | dev | ) |
打开设备
dev | 需打开的设备 |