public class PL25x3Lib
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PL25x3Lib.DataBits |
static class |
PL25x3Lib.FlowControl |
static class |
PL25x3Lib.Parity |
static class |
PL25x3Lib.StopBits |
| Modifier and Type | Field and Description |
|---|---|
static int |
BAUD12000000 |
static int |
BAUD24000000 |
static int |
BAUD2457600 |
static int |
BAUD3000000 |
static int |
BAUD6000000 |
static int |
PL25x3_CTS_ON |
static int |
PL25x3_DCD_ON |
static int |
PL25x3_DSR_ON |
static int |
PL25x3_RI_ON |
java.lang.String |
PLUART_DETACHED |
java.lang.String |
PLUART_MESSAGE |
| Constructor and Description |
|---|
PL25x3Lib(UsbManager manager,
Context context,
java.lang.String sAppName)
Initialize a PL25x3 driver, the software 4K Queue buffer is enable.
|
PL25x3Lib(UsbManager manager,
Context context,
java.lang.String sAppName,
boolean bWithQueue)
Initialize a PL25x3 driver
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
convertIntToHex(int i) |
int |
PL2303G_GPIO_B_CNT_ENABLE(int index,
boolean Enable)
PL25x3 has 8 software controllable ¡§General Purpose Input Output¡¨ control signal pin, you can use this API to Init GPIO_B
|
void |
PL25x3_Close()
Close an PL25x3 USB Device
|
void |
PL25x3_CloseDeviceByIndex(int index)
Close an PL-UART USB Device by index
|
int |
PL25x3_Enumerate()
Found a PL25x3 device number
|
int |
PL25x3_GetBcdByIndex(int index) |
int[] |
PL25x3_GetCommModemStatus(int index)
The PL25x3_GetCommModemStatus function retrieves modem
control-register values.
|
boolean |
PL25x3_GetCommTimeouts(int TimeoutConstant)
The PL25x3_GetCommTimeouts function retrieves the time-out
parameters for all read and write operations on a specified
communications device.
|
java.lang.String |
PL25x3_GetDevicePathByIndex(int index)
Get the Device Path..
|
int |
PL25x3_GetProlificUSBDeviceCount()
Returns the active device number of PL25x3.
|
java.lang.String |
PL25x3_GetSdkVersion() |
java.lang.String |
PL25x3_GetSerialByIndex(int index)
Returns the serial number for the device.
|
java.lang.String |
PL25x3_GetSerialNumber(int index) |
int |
PL25x3_GPIO_ENABLE(int Port_Index,
int GPIO_Index,
int GPIOmode)
Can use this API to Init GPIO
|
int[] |
PL25x3_GPIO_Read(int Port_Index,
int GPIO_Index)
Can use this API to get the status of these pin when the direction is input mode
|
int |
PL25x3_GPIO_Write(int Port_Index,
int GPIO_Index,
int GPIO_Val)
Can use this API to control the status of these pin when the direction is output mode
|
boolean |
PL25x3_IsDeviceConnectedByIndex(int index)
Get the connection status of this PL25x3, ie, whether there is an
active connection with PL25x3 device.
|
boolean |
PL25x3_IsSupportChip(int index)
Detecting whether this PL25x3 supports this Android OS, only PL2543 / PL2303EA / RL2303RA are supported.
|
boolean |
PL25x3_OpenDevByBaudRate(int index,
int nBaudRate)
Open an PL-UART USB Device by baudrate
|
boolean |
PL25x3_OpenDevByDefualtSetting(int index)
Open an PL-UART USB Device by default UART setting
|
boolean |
PL25x3_OpenDevByUARTSetting(int index,
int nBaudRate,
PL25x3Lib.DataBits dataBits,
PL25x3Lib.StopBits stopBits,
PL25x3Lib.Parity parity,
PL25x3Lib.FlowControl flowControl)
Open an PL-UART USB Device by UART setting
|
int |
PL25x3_Read(int index,
byte[] buf)
Read Binary Data from PL25x3 chip
|
void |
PL25x3_ReSetStatus()
ReSet Port Status
|
boolean |
PL25x3_SetCommTimeouts(int TimeoutConstant)
The PL25x3_SetCommTimeouts function sets the time-out parameters
for all read and write operations on a specified communications device.
|
int |
PL25x3_SetDTR(int index,
boolean state)
Switch PL25x3 DTR on or off
|
int |
PL25x3_SetRTS(int index,
boolean state)
Switch PL25x3 RTS on or off
|
int |
PL25x3_SetupCOMPort(int index,
int nBaudRate,
PL25x3Lib.DataBits dataBits,
PL25x3Lib.StopBits stopBits,
PL25x3Lib.Parity parity,
PL25x3Lib.FlowControl flowControl)
Setup basic communication parameters on PL25x3 chip
|
boolean |
PL25x3_USBFeatureSupported()
Detecting whether this Android OS supports USB host API feature
|
int |
PL25x3_Write(int index,
byte[] buf)
Writes n bytes Data to PL-UART chipset
|
public static final int BAUD2457600
public static final int BAUD3000000
public static final int BAUD6000000
public static final int BAUD12000000
public static final int BAUD24000000
public static final int PL25x3_DCD_ON
public static final int PL25x3_DSR_ON
public static final int PL25x3_RI_ON
public static final int PL25x3_CTS_ON
public java.lang.String PLUART_MESSAGE
public java.lang.String PLUART_DETACHED
public PL25x3Lib(UsbManager manager,
Context context,
java.lang.String sAppName)
manager - [in] Initialize a PL25x3 driver.context - [in] Initialize a PL25x3 driver.sAppName - [in] , ACTION_USB_PERMISSION string, for example:
"tw.com.prolific.pl2303hxdgpio.USB_PERMISSION"
"com.prolific.pl2303hxdsimpletest.USB_PERMISSION"
"XXX.AAA.CCC.USB_PERMISSION"public PL25x3Lib(UsbManager manager,
Context context,
java.lang.String sAppName,
boolean bWithQueue)
manager - [in] Initialize a PL25x3 driver.context - [in] Initialize a PL25x3 driver.sAppName - [in] ACTION_USB_PERMISSION string, for example:
"tw.com.prolific.pl2303hxdgpio.USB_PERMISSION"
"com.prolific.pl2303hxdsimpletest.USB_PERMISSION"
"XXX.AAA.CCC.USB_PERMISSION"bWithQueue - , Specifies the software 4K Queue buffer is enable or disablepublic static final java.lang.String convertIntToHex(int i)
public void PL25x3_Close()
public boolean PL25x3_USBFeatureSupported()
public void PL25x3_ReSetStatus()
public int PL25x3_Enumerate()
public int PL25x3_GetBcdByIndex(int index)
public boolean PL25x3_IsDeviceConnectedByIndex(int index)
index - usb-device indexpublic java.lang.String PL25x3_GetDevicePathByIndex(int index)
index - usb-device indexpublic java.lang.String PL25x3_GetSerialByIndex(int index)
index - usb-device indexpublic int PL25x3_GetProlificUSBDeviceCount()
public int PL25x3_Write(int index,
byte[] buf)
index - usb-device indexbuf - write bufferpublic int PL25x3_Read(int index,
byte[] buf)
index - usb-device indexbuf - read bufferpublic boolean PL25x3_OpenDevByDefualtSetting(int index)
index - usb-device indexpublic boolean PL25x3_OpenDevByBaudRate(int index,
int nBaudRate)
index - usb-device indexnBaudRate - BaudRatepublic boolean PL25x3_OpenDevByUARTSetting(int index,
int nBaudRate,
PL25x3Lib.DataBits dataBits,
PL25x3Lib.StopBits stopBits,
PL25x3Lib.Parity parity,
PL25x3Lib.FlowControl flowControl)
index - usb-device indexnBaudRate - BaudRatedataBits - DataBitsstopBits - StopBitsparity - ParityflowControl - FlowControlpublic void PL25x3_CloseDeviceByIndex(int index)
index - usb-device indexpublic int PL25x3_SetupCOMPort(int index,
int nBaudRate,
PL25x3Lib.DataBits dataBits,
PL25x3Lib.StopBits stopBits,
PL25x3Lib.Parity parity,
PL25x3Lib.FlowControl flowControl)
throws java.io.IOException
index - usb-device indexnBaudRate - BaudRatedataBits - DataBitsstopBits - StopBitsparity - ParityflowControl - FlowControljava.io.IOException - if settings not supported or connection is closedpublic boolean PL25x3_IsSupportChip(int index)
index - usb-device index Returns true indicates this PL2303 chip is
supported, else false.public boolean PL25x3_SetCommTimeouts(int TimeoutConstant)
TimeoutConstant - Timeout Constant of read and writepublic boolean PL25x3_GetCommTimeouts(int TimeoutConstant)
TimeoutConstant - Timeout Constant of read and writepublic java.lang.String PL25x3_GetSerialNumber(int index)
public int PL25x3_SetDTR(int index,
boolean state)
state - true: SET DTR, false: CLEAR DTRpublic int PL25x3_SetRTS(int index,
boolean state)
state - true: SET RTS, false: CLEAR RTSpublic int PL2303G_GPIO_B_CNT_ENABLE(int index,
boolean Enable)
index - [in] usb-device indexEnable - [in] True is Output mode, false is input mode.public int[] PL25x3_GetCommModemStatus(int index)
public int PL25x3_GPIO_ENABLE(int Port_Index,
int GPIO_Index,
int GPIOmode)
Port_Index - [in] Port numberGPIO_Index - [in] GPIO numberGPIOmode - mode [in] The range is 0 ~ 2, 2: Output mode, 1: input mode, 0: default mode.public int PL25x3_GPIO_Write(int Port_Index,
int GPIO_Index,
int GPIO_Val)
Port_Index - [in] Port numberGPIO_Index - [in] GPIO numberGPIO_Val - [in] ¡§1¡¨ is High level, 0 is low level , the range is 0 ~ 1public int[] PL25x3_GPIO_Read(int Port_Index,
int GPIO_Index)
Port_Index - [in] The Port numberGPIO_Index - [in] The GPIO numberpublic java.lang.String PL25x3_GetSdkVersion()