public class USBUtil
extends java.lang.Object
Constructor and Description |
---|
USBUtil() |
Modifier and Type | Method and Description |
---|---|
UsbDevice |
closeport() |
java.util.List<UsbDevice> |
getDeviceList(Context context)
获取 USB 设备列表
|
UsbDevice |
getUsbDevice(int vendorId,
int productId) |
void |
init(Context context) |
int |
openPort(UsbDevice device)
打开通信端口
|
byte[] |
receive() |
int |
send(byte[] bytes) |
byte[] |
sendAndReceive(byte[] bytes,
boolean isInventory) |
void |
setKeyEventCallback(KeyEventCallback KeyEventCallback) |
public void setKeyEventCallback(KeyEventCallback KeyEventCallback)
public int openPort(UsbDevice device)
public UsbDevice closeport()
public byte[] receive()
public int send(byte[] bytes)
public byte[] sendAndReceive(byte[] bytes, boolean isInventory)
public void init(Context context)
public java.util.List<UsbDevice> getDeviceList(Context context)
public UsbDevice getUsbDevice(int vendorId, int productId)
vendorId
- 厂商IDproductId
- 产品ID