tw.com.prolific.pl2303multilib

## Class PL2303MultiLib

- java.lang.Object
- - tw.com.prolific.pl2303multilib.PL2303MultiLib

-     public class PL2303MultiLib
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PL2303MultiLib.BaudRate`
    `static class` | `PL2303MultiLib.DataBits`
    `static class` | `PL2303MultiLib.FlowControl`
    `static class` | `PL2303MultiLib.Parity`
    `static class` | `PL2303MultiLib.StopBits`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BAUD0`
    `static int` | `BAUD115200`
    `static int` | `BAUD1200`
    `static int` | `BAUD1228800`
    `static int` | `BAUD14400`
    `static int` | `BAUD150`
    `static int` | `BAUD1800`
    `static int` | `BAUD19200`
    `static int` | `BAUD230400`
    `static int` | `BAUD2400`
    `static int` | `BAUD2457600`
    `static int` | `BAUD300`
    `static int` | `BAUD3000000`
    `static int` | `BAUD38400`
    `static int` | `BAUD460800`
    `static int` | `BAUD4800`
    `static int` | `BAUD57600`
    `static int` | `BAUD600`
    `static int` | `BAUD6000000`
    `static int` | `BAUD614400`
    `static int` | `BAUD75`
    `static int` | `BAUD921600`
    `static int` | `BAUD9600`
    `static int` | `PL2303HXD_CTS_ON`
    `static int` | `PL2303HXD_DCD_ON`
    `static int` | `PL2303HXD_DSR_ON`
    `static int` | `PL2303HXD_RI_ON`
    `java.lang.String` | `PLUART_DETACHED`
    `java.lang.String` | `PLUART_MESSAGE`
    `java.util.Hashtable<java.lang.String,java.lang.String>` | `Prolific_DevicePath_2_COMNumber`
    `java.util.Hashtable<java.lang.String,UsbDevice>` | `ProlificUSBCurrentDeviceList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PL2303MultiLib(UsbManager manager, Context context, java.lang.String sAppName)` Initialize a PL2303HXD driver, the software 4K Queue buffer is enable.
    `PL2303MultiLib(UsbManager manager, Context context, java.lang.String sAppName, boolean bWithQueue)` Initialize a PL2303HXD driver

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `EnableFixed_COMPort_Mode()` Enable Fixed COM port Mode
    `int` | `enumerate()` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Enumerate()` Found a PL2303HXD device number , the default VID_PID is 067B_2303
    `java.lang.String` | `getDevicePathByIndex(int index)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303getDevicePathByIndex(int index)` Get the Device Path..
    `boolean` | `isDeviceConnectedByIndex(int index)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303IsDeviceConnectedByIndex(int index)` Get the connection status of this PL2303HXD, ie, whether there is an active connection with PL2303HXD device.
    `boolean` | `IsPL2303TBChip(int index)` Detecting whether this PL2303 supports this Android OS, only PL2303HXD / PL2303EA / RL2303RA are supported.
    `boolean` | `OpenDevByUARTSetting(int index, PL2303MultiLib.BaudRate R, PL2303MultiLib.DataBits D, PL2303MultiLib.StopBits S, PL2303MultiLib.Parity P, PL2303MultiLib.FlowControl F)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303OpenDevByUARTSetting(int index, BaudRate R, DataBits D, StopBits S, Parity P, FlowControl F)` Open an PL-UART USB Device by UART setting
    `void` | `PL2303CloseDeviceByIndex(int index)` Close an PL-UART USB Device by index
    `boolean` | `PL2303Device_GetCommTimeouts(int TimeoutConstant)` The PL2303Device_GetCommTimeouts function retrieves the time-out parameters for all read and write operations on a specified communications device.
    `java.lang.String` | `PL2303Device_GetSerialNumber(int index)`
    `boolean` | `PL2303Device_IsSupportChip(int index)` Detecting whether this PL2303 supports this Android OS, only PL2303HXD / PL2303EA / RL2303RA are supported.
    `boolean` | `PL2303Device_SetCommTimeouts(int TimeoutConstant)` The PL2303Device_SetCommTimeouts function sets the time-out parameters for all read and write operations on a specified communications device.
    `int` | `PL2303Enumerate()` Found a PL2303HXD device number , the default VID_PID is 067B_2303
    `java.lang.String` | `PL2303getCOMNumber(int index)` Get the PL2303HXD COM port Number : COM1, COM2, COM3....
    `java.lang.String` | `PL2303getDevicePathByIndex(int index)` Get the Device Path..
    `int` | `PL2303getProlificUSBDeviceCount()` Returns the active device number of PL2303.
    `java.lang.String` | `PL2303getSerialByIndex(int index)` Returns the serial number for the device.
    `int` | `PL2303HXD_Enable_GPIO(int index, int GPIO_Num, boolean Enable)` PL2303HXD has 8 software controllable ¡§General Purpose Input Output¡¨ control signal pin, you can use this API to control the direction of these pin
    `int[]` | `PL2303HXD_Get_GPIO_Value(int index, int GPIO_Num)` PL2303HXD has 8 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
    `int[]` | `PL2303HXD_GetCommModemStatus(int index)` The PL2303HXD_GetCommModemStatus function retrieves modem control-register values.
    `void` | `PL2303HXD_ReSetStatus()` ReSet Port Status
    `int` | `PL2303HXD_Set_GPIO_Value(int index, int GPIO_Num, int val)` PL2303HXD has 8 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` | `PL2303HXD_SetDTR(int index, boolean state)` Switch PL2303HXD DTR on or off
    `int` | `PL2303HXD_SetRTS(int index, boolean state)` Switch PL2303HXD RTS on or off
    `boolean` | `PL2303IsDeviceConnectedByIndex(int index)` Get the connection status of this PL2303HXD, ie, whether there is an active connection with PL2303HXD device.
    `int` | `PL2303LibGetVersion(byte[] byVersion)` Get Lib version
    `boolean` | `PL2303OpenDevByBaudRate(int index, PL2303MultiLib.BaudRate R)` Open an PL-UART USB Device by baudrate
    `boolean` | `PL2303OpenDevByDefualtSetting(int index)` Open an PL-UART USB Device by default UART setting
    `boolean` | `PL2303OpenDevByUARTSetting(int index, PL2303MultiLib.BaudRate R, PL2303MultiLib.DataBits D, PL2303MultiLib.StopBits S, PL2303MultiLib.Parity P, PL2303MultiLib.FlowControl F)` Open an PL-UART USB Device by UART setting
    `int` | `PL2303Read(int index, byte[] buf)` Read Binary Data from PL2303HXD chip
    `void` | `PL2303Release()` Close an PL2303HXD USB Device
    `int` | `PL2303SetupCOMPort(int index, PL2303MultiLib.BaudRate R, PL2303MultiLib.DataBits D, PL2303MultiLib.StopBits S, PL2303MultiLib.Parity P, PL2303MultiLib.FlowControl F)` Setup basic communication parameters on PL2303HXD chip
    `int` | `PL2303TB_Enable_GPIO(int index, int GPIO_Num, boolean Enable)` PL2303TB has 12 software controllable ¡§General Purpose Input Output¡¨ control signal pin, you can use this API to control the direction of these pin, you also can use "PL2303HXD Enable GPIO" API to control GPIO 0~7 of PL2303TB
    `int[]` | `PL2303TB_Get_GPIO_Value(int index, int GPIO_Num)` PL2303TB has 12 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,, you also can use "PL2303HXD_Get_GPIO_Value" API to control GPIO 0~7 of PL2303TB
    `int` | `PL2303TB_Set_GPIO_Value(int index, int GPIO_Num, int val)` PL2303TB has 12 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, you also can use "PL2303HXD_Set_GPIO_Value" API to control GPIO 0~7 of PL2303TB
    `int` | `PL2303TB_Set_PWM(int index, int PWM_IO_Num, byte Frequency_value, byte Duty_value)` PL2303TB supports 4 PWM control output, the frequency range is from 366.3Hz to 46.5 KHz, and the pulse high duty can be set from 1/256 to 255/256 in each frequency.
    `boolean` | `PL2303USBFeatureSupported()` Detecting whether this Android OS supports USB host API feature
    `int` | `PL2303Write(int index, byte[] buf)` Writes n bytes Data to PL-UART chipset
    `int` | `read(int index, byte[] buf)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Read(int index, byte[] buf)` Read Binary Data from PL2303HXD chip
    `void` | `release()` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Release()` Close an PL2303HXD USB Device
    `int` | `setup(int index, PL2303MultiLib.BaudRate R, PL2303MultiLib.DataBits D, PL2303MultiLib.StopBits S, PL2303MultiLib.Parity P, PL2303MultiLib.FlowControl F)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303SetupCOMPort(int index, BaudRate R, DataBits D, StopBits S, Parity P, FlowControl F)` Setup basic communication parameters on PL2303HXD chip
    `int` | `write(int index, byte[] buf)` Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Write(int index, byte[] buf)` Writes n bytes Data to PL-UART chipset

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BAUD0

          public static final int BAUD0

      See Also:
        Constant Field Values

    - #### BAUD75

          public static final int BAUD75

      See Also:
        Constant Field Values

    - #### BAUD150

          public static final int BAUD150

      See Also:
        Constant Field Values

    - #### BAUD300

          public static final int BAUD300

      See Also:
        Constant Field Values

    - #### BAUD600

          public static final int BAUD600

      See Also:
        Constant Field Values

    - #### BAUD1200

          public static final int BAUD1200

      See Also:
        Constant Field Values

    - #### BAUD1800

          public static final int BAUD1800

      See Also:
        Constant Field Values

    - #### BAUD2400

          public static final int BAUD2400

      See Also:
        Constant Field Values

    - #### BAUD4800

          public static final int BAUD4800

      See Also:
        Constant Field Values

    - #### BAUD9600

          public static final int BAUD9600

      See Also:
        Constant Field Values

    - #### BAUD14400

          public static final int BAUD14400

      See Also:
        Constant Field Values

    - #### BAUD19200

          public static final int BAUD19200

      See Also:
        Constant Field Values

    - #### BAUD38400

          public static final int BAUD38400

      See Also:
        Constant Field Values

    - #### BAUD57600

          public static final int BAUD57600

      See Also:
        Constant Field Values

    - #### BAUD115200

          public static final int BAUD115200

      See Also:
        Constant Field Values

    - #### BAUD230400

          public static final int BAUD230400

      See Also:
        Constant Field Values

    - #### BAUD460800

          public static final int BAUD460800

      See Also:
        Constant Field Values

    - #### BAUD614400

          public static final int BAUD614400

      See Also:
        Constant Field Values

    - #### BAUD921600

          public static final int BAUD921600

      See Also:
        Constant Field Values

    - #### BAUD1228800

          public static final int BAUD1228800

      See Also:
        Constant Field Values

    - #### BAUD2457600

          public static final int BAUD2457600

      See Also:
        Constant Field Values

    - #### BAUD3000000

          public static final int BAUD3000000

      See Also:
        Constant Field Values

    - #### BAUD6000000

          public static final int BAUD6000000

      See Also:
        Constant Field Values

    - #### PL2303HXD_DCD_ON

          public static final int PL2303HXD_DCD_ON

      See Also:
        Constant Field Values

    - #### PL2303HXD_DSR_ON

          public static final int PL2303HXD_DSR_ON

      See Also:
        Constant Field Values

    - #### PL2303HXD_RI_ON

          public static final int PL2303HXD_RI_ON

      See Also:
        Constant Field Values

    - #### PL2303HXD_CTS_ON

          public static final int PL2303HXD_CTS_ON

      See Also:
        Constant Field Values

    - #### PLUART_MESSAGE

          public java.lang.String PLUART_MESSAGE

    - #### PLUART_DETACHED

          public java.lang.String PLUART_DETACHED

    - #### ProlificUSBCurrentDeviceList

          public java.util.Hashtable<java.lang.String,UsbDevice> ProlificUSBCurrentDeviceList

    - #### Prolific_DevicePath_2_COMNumber

          public java.util.Hashtable<java.lang.String,java.lang.String> Prolific_DevicePath_2_COMNumber

  - ### Constructor Detail

    - #### PL2303MultiLib

          public PL2303MultiLib(UsbManager manager,
                                Context context,
                                java.lang.String sAppName)

      Initialize a PL2303HXD driver, the software 4K Queue buffer is enable.
      Parameters:
        `manager` - [in] Initialize a PL2303HXD driver.
        `context` - [in] Initialize a PL2303HXD 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"

    - #### PL2303MultiLib

          public PL2303MultiLib(UsbManager manager,
                                Context context,
                                java.lang.String sAppName,
                                boolean bWithQueue)

      Initialize a PL2303HXD driver
      Parameters:
        `manager` - [in] Initialize a PL2303HXD driver.
        `context` - [in] Initialize a PL2303HXD 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 disable

  - ### Method Detail

    - #### PL2303Release

          public void PL2303Release()

      Close an PL2303HXD USB Device

    - #### release

          public void release()

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Release()` Close an PL2303HXD USB Device

    - #### PL2303USBFeatureSupported

          public boolean PL2303USBFeatureSupported()

      Detecting whether this Android OS supports USB host API feature
      Returns:
        Zero indicates the devices supports the USB HOST API feature. else false.

    - #### PL2303LibGetVersion

          public int PL2303LibGetVersion(byte[] byVersion)

      Get Lib version
      Parameters:
        `byVersion` - [out] Lib version, ex: 0.0.0.10
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303HXD_ReSetStatus

          public void PL2303HXD_ReSetStatus()

      ReSet Port Status

    - #### PL2303Enumerate

          public int PL2303Enumerate()

      Found a PL2303HXD device number , the default VID_PID is 067B_2303
      Returns:
        0 indicates: no more devices found, 1: indicates 1 devices found

    - #### enumerate

          public int enumerate()

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Enumerate()` Found a PL2303HXD device number , the default VID_PID is 067B_2303
      Returns:
        0 indicates: no more devices found, 1: indicates 1 devices found

    - #### PL2303IsDeviceConnectedByIndex

          public boolean PL2303IsDeviceConnectedByIndex(int index)

      Get the connection status of this PL2303HXD, ie, whether there is an active connection with PL2303HXD device.
      Parameters:
        `index` - : usb-device index
      Returns:
        true if connected false if not connected

    - #### isDeviceConnectedByIndex

          public boolean isDeviceConnectedByIndex(int index)

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303IsDeviceConnectedByIndex(int index)` Get the connection status of this PL2303HXD, ie, whether there is an active connection with PL2303HXD device.
      Parameters:
        `index` - : usb-device index
      Returns:
        true if connected false if not connected

    - #### PL2303getDevicePathByIndex

          public java.lang.String PL2303getDevicePathByIndex(int index)

      Get the Device Path..
      Parameters:
        `index` - : usb-device index
      Returns:
        String: Device Path

    - #### PL2303getCOMNumber

          public java.lang.String PL2303getCOMNumber(int index)

      Get the PL2303HXD COM port Number : COM1, COM2, COM3....
      Parameters:
        `index` - : usb-device index, the number is between 0 and 7.
      Returns:
        String: COM port Number: COM1, COM2, COM3...COM6, COOM7

    - #### EnableFixed_COMPort_Mode

          public boolean EnableFixed_COMPort_Mode()

      Enable Fixed COM port Mode

    - #### getDevicePathByIndex

          public java.lang.String getDevicePathByIndex(int index)

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303getDevicePathByIndex(int index)` Get the Device Path..
      Parameters:
        `index` - : usb-device index
      Returns:
        String: Device Path

    - #### PL2303getSerialByIndex

          public java.lang.String PL2303getSerialByIndex(int index)

      Returns the serial number for the device. This will return null if the device has not been opened
      Parameters:
        `index` - : usb-device index
      Returns:
        String: Device Path

    - #### PL2303getProlificUSBDeviceCount

          public int PL2303getProlificUSBDeviceCount()

      Returns the active device number of PL2303.
      Returns:
        int : active device number

    - #### PL2303Write

          public int PL2303Write(int index,
                                 byte[] buf)

      Writes n bytes Data to PL-UART chipset
      Parameters:
        `index` - : usb-device index
        `buf` - : write buffer
      Returns:
        written length

    - #### write

          public int write(int index,
                           byte[] buf)

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Write(int index, byte[] buf)` Writes n bytes Data to PL-UART chipset
      Parameters:
        `index` - : usb-device index
        `buf` - : write buffer
      Returns:
        written length

    - #### PL2303Read

          public int PL2303Read(int index,
                                byte[] buf)

      Read Binary Data from PL2303HXD chip
      Parameters:
        `int` - : usb-device index
        `buf` - : read buffer
      Returns:
        buffer length

    - #### read

          public int read(int index,
                          byte[] buf)

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303Read(int index, byte[] buf)` Read Binary Data from PL2303HXD chip
      Parameters:
        `int` - : usb-device index
        `buf` - : read buffer
      Returns:
        buffer length

    - #### PL2303OpenDevByDefualtSetting

          public boolean PL2303OpenDevByDefualtSetting(int index)

      Open an PL-UART USB Device by default UART setting
      Parameters:
        `int` -
      Returns:
        true if the PL2303HXD USB Device was successfully opened

    - #### PL2303OpenDevByBaudRate

          public boolean PL2303OpenDevByBaudRate(int index,
                                                 PL2303MultiLib.BaudRate R)

      Open an PL-UART USB Device by baudrate
      Parameters:
        `int` -
        `BaudRate` -
      Returns:
        true if the PL2303HXD USB Device was successfully opened

    - #### PL2303OpenDevByUARTSetting

          public boolean PL2303OpenDevByUARTSetting(int index,
                                                    PL2303MultiLib.BaudRate R,
                                                    PL2303MultiLib.DataBits D,
                                                    PL2303MultiLib.StopBits S,
                                                    PL2303MultiLib.Parity P,
                                                    PL2303MultiLib.FlowControl F)

      Open an PL-UART USB Device by UART setting
      Parameters:
        `int` - index
        `Enum` - BaudRate
        `Enum` - DataBits
        `Enum` - StopBits
        `Enum` - Parity
        `Enum` - FlowControl
      Returns:
        true if the PL2303HXD USB Device was successfully opened

    - #### OpenDevByUARTSetting

          public boolean OpenDevByUARTSetting(int index,
                                              PL2303MultiLib.BaudRate R,
                                              PL2303MultiLib.DataBits D,
                                              PL2303MultiLib.StopBits S,
                                              PL2303MultiLib.Parity P,
                                              PL2303MultiLib.FlowControl F)

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303OpenDevByUARTSetting(int index, BaudRate R, DataBits D, StopBits S, Parity P, FlowControl F)` Open an PL-UART USB Device by UART setting
      Parameters:
        `int` - index
        `Enum` - BaudRate
        `Enum` - DataBits
        `Enum` - StopBits
        `Enum` - Parity
        `Enum` - FlowControl
      Returns:
        true if the PL2303HXD USB Device was successfully opened

    - #### PL2303CloseDeviceByIndex

          public void PL2303CloseDeviceByIndex(int index)

      Close an PL-UART USB Device by index
      Parameters:
        `int` - : usb-device index

    - #### PL2303SetupCOMPort

          public int PL2303SetupCOMPort(int index,
                                        PL2303MultiLib.BaudRate R,
                                        PL2303MultiLib.DataBits D,
                                        PL2303MultiLib.StopBits S,
                                        PL2303MultiLib.Parity P,
                                        PL2303MultiLib.FlowControl F)
                                 throws java.io.IOException

      Setup basic communication parameters on PL2303HXD chip
      Parameters:
        `int` - index
        `Enum` - BaudRate
        `Enum` - DataBits
        `Enum` - StopBits
        `Enum` - Parity
        `Enum` - FlowControl
      Throws:
        `java.io.IOException` - if settings not supported or connection is closed

    - #### setup

          public int setup(int index,
                           PL2303MultiLib.BaudRate R,
                           PL2303MultiLib.DataBits D,
                           PL2303MultiLib.StopBits S,
                           PL2303MultiLib.Parity P,
                           PL2303MultiLib.FlowControl F)
                    throws java.io.IOException

      Deprecated. As of PL2303HXD MultiLib_v0.0.1.20, replaced by `PL2303SetupCOMPort(int index, BaudRate R, DataBits D, StopBits S, Parity P, FlowControl F)` Setup basic communication parameters on PL2303HXD chip
      Parameters:
        `int` - index
        `Enum` - BaudRate
        `Enum` - DataBits
        `Enum` - StopBits
        `Enum` - Parity
        `Enum` - FlowControl
      Throws:
        `java.io.IOException` - if settings not supported or connection is closed

    - #### PL2303Device_IsSupportChip

          public boolean PL2303Device_IsSupportChip(int index)

      Detecting whether this PL2303 supports this Android OS, only PL2303HXD / PL2303EA / RL2303RA are supported.
      Parameters:
        `int` - : usb-device index Returns true indicates this PL2303 chip is supported, else false.

    - #### PL2303Device_SetCommTimeouts

          public boolean PL2303Device_SetCommTimeouts(int TimeoutConstant)

      The PL2303Device_SetCommTimeouts function sets the time-out parameters for all read and write operations on a specified communications device.
      Parameters:
        `TimeoutConstant` - : Timeout Constant of read and write
      Returns:
        If the function succeeds, the return value is true. If the function fails, the return value is false.

    - #### PL2303Device_GetCommTimeouts

          public boolean PL2303Device_GetCommTimeouts(int TimeoutConstant)

      The PL2303Device_GetCommTimeouts function retrieves the time-out parameters for all read and write operations on a specified communications device.
      Parameters:
        `TimeoutConstant` - : Timeout Constant of read and write
      Returns:
        If the function succeeds, the return value is true. If the function fails, the return value is false.

    - #### PL2303Device_GetSerialNumber

          public java.lang.String PL2303Device_GetSerialNumber(int index)

    - #### PL2303TB_Set_PWM

          public int PL2303TB_Set_PWM(int index,
                                      int PWM_IO_Num,
                                      byte Frequency_value,
                                      byte Duty_value)

      PL2303TB supports 4 PWM control output, the frequency range is from 366.3Hz to 46.5 KHz, and the pulse high duty can be set from 1/256 to 255/256 in each frequency.
      Parameters:
        `index` - [in] usb-device index
        `PWM_IO_Num` - [in] Pin mapping PWM[0:3] [DTR. DCD, DSR, CTS]
        `Frequency_value` - [in] It would set the Frequency.
        `Duty_value` - [in] It would set the Duty.
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303TB_Enable_GPIO

          public int PL2303TB_Enable_GPIO(int index,
                                          int GPIO_Num,
                                          boolean Enable)

      PL2303TB has 12 software controllable ¡§General Purpose Input Output¡¨ control signal pin, you can use this API to control the direction of these pin, you also can use "PL2303HXD Enable GPIO" API to control GPIO 0~7 of PL2303TB
      Parameters:
        `index` - [in] usb-device index
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 12
        `Enable` - [in] True is Output mode, false is input mode.
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303TB_Set_GPIO_Value

          public int PL2303TB_Set_GPIO_Value(int index,
                                             int GPIO_Num,
                                             int val)

      PL2303TB has 12 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, you also can use "PL2303HXD_Set_GPIO_Value" API to control GPIO 0~7 of PL2303TB
      Parameters:
        `index` - [in] usb-device index
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 11
        `val` - [in] ¡§1¡¨ is High level, 0 is low level.
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303TB_Get_GPIO_Value

          public int[] PL2303TB_Get_GPIO_Value(int index,
                                               int GPIO_Num)

      PL2303TB has 12 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,, you also can use "PL2303HXD_Get_GPIO_Value" API to control GPIO 0~7 of PL2303TB
      Parameters:
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 11
      Returns:
        int[] [0]: Zero(or positive value) indicates success. Nonzero indicates failure. [1]: Return data for GPIO value.¡§1¡¨ is High level, 0 is low level.

    - #### PL2303HXD_Enable_GPIO

          public int PL2303HXD_Enable_GPIO(int index,
                                           int GPIO_Num,
                                           boolean Enable)

      PL2303HXD has 8 software controllable ¡§General Purpose Input Output¡¨ control signal pin, you can use this API to control the direction of these pin
      Parameters:
        `index` - [in] usb-device index
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 7
        `Enable` - [in] True is Output mode, false is input mode.
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303HXD_Set_GPIO_Value

          public int PL2303HXD_Set_GPIO_Value(int index,
                                              int GPIO_Num,
                                              int val)

      PL2303HXD has 8 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
      Parameters:
        `index` - [in] usb-device index
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 7
        `val` - [in] ¡§1¡¨ is High level, 0 is low level.
      Returns:
        Zero indicates success. Nonzero indicates failure.

    - #### PL2303HXD_Get_GPIO_Value

          public int[] PL2303HXD_Get_GPIO_Value(int index,
                                                int GPIO_Num)

      PL2303HXD has 8 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
      Parameters:
        `index` - [in] usb-device index
        `GPIO_Num` - [in] The GPIO number, the range is 0 ~ 7
      Returns:
        int[] [0]: Zero(or positive value) indicates success. Nonzero indicates failure. [1]: Return data for GPIO value.¡§1¡¨ is High level, 0 is low level.

    - #### PL2303HXD_SetDTR

          public int PL2303HXD_SetDTR(int index,
                                      boolean state)

      Switch PL2303HXD DTR on or off
      Parameters:
        `state` - true: SET DTR, false: CLEAR DTR

    - #### PL2303HXD_SetRTS

          public int PL2303HXD_SetRTS(int index,
                                      boolean state)

      Switch PL2303HXD RTS on or off
      Parameters:
        `state` - true: SET RTS, false: CLEAR RTS

    - #### PL2303HXD_GetCommModemStatus

          public int[] PL2303HXD_GetCommModemStatus(int index)

      The PL2303HXD_GetCommModemStatus function retrieves modem control-register values.
      Returns:
        int[] [0]: Zero indicates success. Nonzero indicates failure. [1]: Return data for ModemStatus (DCD, RI, DSR, DCTS)

    - #### IsPL2303TBChip

          public boolean IsPL2303TBChip(int index)

      Detecting whether this PL2303 supports this Android OS, only PL2303HXD / PL2303EA / RL2303RA are supported.
      Parameters:
        `int` - : usb-device index Returns true indicates this PL2303 chip is supported, else false.