| Constructor and Description |
|---|
HidToGpio()
New a HidToGPIO driver object.
|
HidToGpio(android.content.Context context,
java.lang.String strAppName)
New a HidToGPIO driver object.
|
| Modifier and Type | Method and Description |
|---|---|
int |
askPermissionByDeviceIndex(int nDeviceIndex)
Obtain permission to communicate with a device by given device name
|
int |
askPermissionByUsbDevice(android.hardware.usb.UsbDevice usbDevice)
Obtain permission to communicate with the given device.
|
int |
closeDevice()
Close the PL23B3, PL23C3, or PL23D3 device.
|
int |
closeDeviceByDeviceIndex(int nDeviceIndex) |
void |
dumpMsg(java.lang.Object objMsg)
Dump log into sdk.
|
int |
enumDevices(int nDeviceVid)
Found a PL23B3, PL23C3, or PL23D3 device , the default VID is 067B
|
int |
enumDevices(int nDeviceVid,
int nDevicePid)
Found a PL23B3, PL23C3, or PL23D3 device by given VID and PID
|
java.lang.String |
getDeviceName(int nDeviceIndex)
Gets device name by given index.
|
int |
getGpio(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioObject gpioObject)
PL23B3, PL23C3, and PL23D3 has some software controllable "General Purpose Input Output" control signal pin, you can use this API to get the status of these pin when the direction is input mode
|
java.lang.String |
getSdkVersion()
Gets SDK version.
|
java.lang.String |
getSerialNumber(int nDeviceIndex)
Gets device serial number by given index.
|
android.hardware.usb.UsbDevice |
getUsbDevice(int nDeviceIndex)
Gets UsbDevice object by given index
|
boolean |
hasPermissionByDeviceIndex(int nDeviceIndex)
Detecting whether this device which decided by given index has permission
|
boolean |
hasPermissionByUsbDevice(android.hardware.usb.UsbDevice usbDevice)
check if device has permission or not.
|
int |
openDeviceByIndex(int nDeviceIndex)
Open device by given index.
|
int |
openDeviceBySerialNumber(java.lang.String strSerialNumber)
Open device by given serial number.
|
void |
setCommandTimeOut(int nMillSecond)
Sets device command time out value.
|
int |
setGpio(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioObject gpioObject)
PL23B3, PL23C3, and PL23D3 have some software controllable "General Purpose Input Output" control signal pin, you can use this API to control the status of these pin when the direction is output mode
|
int |
setGpioDir(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioSetting.GpioDir gpioDir)
PL23B3, PL23C3, and PL23D3 have some software controllable "General Purpose Input Output" control signal pin, you can use this API to control the direction of these pin
|
public HidToGpio()
public HidToGpio(android.content.Context context,
java.lang.String strAppName)
context - the contextstrAppName - , ACTION_USB_PERMISSION string, for example: "tw.com.prolific.HidToUartTest.USB_PERMISSION"public int setGpioDir(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioSetting.GpioDir gpioDir)
nDeviceIndex - the device indexgpioPin - the gpio pingpioDir - the gpio direction to setuppublic int setGpio(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioObject gpioObject)
nDeviceIndex - the device indexgpioPin - the gpio pingpioObject - the gpio object to set valuepublic int getGpio(int nDeviceIndex,
GpioSetting.GpioPin gpioPin,
GpioObject gpioObject)
nDeviceIndex - the device indexgpioPin - the gpio pingpioObject - the gpio object to get valuepublic int enumDevices(int nDeviceVid)
nDeviceVid - the device vidpublic int enumDevices(int nDeviceVid,
int nDevicePid)
nDeviceVid - the device vidnDevicePid - the device pidpublic java.lang.String getDeviceName(int nDeviceIndex)
nDeviceIndex - The index of devicepublic java.lang.String getSerialNumber(int nDeviceIndex)
nDeviceIndex - the index of devicepublic int openDeviceByIndex(int nDeviceIndex)
nDeviceIndex - the index of devicepublic int openDeviceBySerialNumber(java.lang.String strSerialNumber)
strSerialNumber - the serial number of devicepublic boolean hasPermissionByDeviceIndex(int nDeviceIndex)
nDeviceIndex - the index of devicepublic int askPermissionByDeviceIndex(int nDeviceIndex)
nDeviceIndex - the index of devicepublic boolean hasPermissionByUsbDevice(android.hardware.usb.UsbDevice usbDevice)
usbDevice - the usb devicepublic int askPermissionByUsbDevice(android.hardware.usb.UsbDevice usbDevice)
usbDevice - the usb devicepublic int closeDevice()
public int closeDeviceByDeviceIndex(int nDeviceIndex)
public java.lang.String getSdkVersion()
public void setCommandTimeOut(int nMillSecond)
nMillSecond - the time value in millisecond.public void dumpMsg(java.lang.Object objMsg)
objMsg - The message content.public android.hardware.usb.UsbDevice getUsbDevice(int nDeviceIndex)
nDeviceIndex - the index of device