public class D2xxManager extends Object
getInstance(Context)
to get a copy of D2xxManager; use
createDeviceInfoList(Context)
method to scan current connected
FTDI devices, then open target device via a suitable open API.Modifier and Type | Class and Description |
---|---|
static class |
D2xxManager.D2xxException
A class for exception debug
Handle exception and print error message
|
static class |
D2xxManager.DriverParameters
A class for read() parameters.
|
static class |
D2xxManager.FtDeviceInfoListNode
Information about a connected FTDI device.
|
Modifier and Type | Field and Description |
---|---|
static byte |
FT_BI
|
static byte |
FT_BITMODE_ASYNC_BITBANG
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_CBUS_BITBANG
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_FAST_SERIAL
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_MCU_HOST
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_MPSSE
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_RESET
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_SYNC_BITBANG
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_BITMODE_SYNC_FIFO
Bit Mode bits :
Reset: FT_BITMODE_RESET ,Asynchronous Bit Bang: FT_BITMODE_ASYNC_BITBANG ,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MPSSE ,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_SYNC_BITBANG ,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_MCU_HOST ,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) : FT_BITMODE_FAST_SERIAL , CBUS Bit Bang Mode (FT232R and FT232H devices only) : FT_BITMODE_CBUS_BITBANG , Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) : FT_BITMODE_SYNC_FIFO |
static byte |
FT_CTS
|
static byte |
FT_DATA_BITS_7
|
static byte |
FT_DATA_BITS_8
|
static byte |
FT_DCD
|
static int |
FT_DEVICE_2232
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_2232H
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_232B
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_232H
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_232R
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_245R
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_4232H
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_8U232AM
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_UNKNOWN
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static int |
FT_DEVICE_X_SERIES
Device Type :
bvdDevice = 0x0200 or 0x0400 and iSerialNumber != 0: FT_DEVICE_232B ,bvdDevice = 0x0200 and iSerialNumber != 0 : FT_DEVICE_8U232AM ,Unknown : FT_DEVICE_UNKNOWN ,bvdDevice = 0x0500 : FT_DEVICE_2232 ,bvdDevice = 0x0600 : FT_DEVICE_232R ,bvdDevice = 0x0600 : FT_DEVICE_245R ,bvdDevice = 0x0700 : FT_DEVICE_2232H ,bvdDevice = 0x0800 : FT_DEVICE_4232H ,bvdDevice = 0x0900 : FT_DEVICE_232H ,bvdDevice = 0x1000 : FT_DEVICE_X_SERIES |
static byte |
FT_DSR
|
static byte |
FT_EVENT_LINE_STATUS
Event bits :
Rx Char Event: FT_EVENT_RXCHAR ,Modem Status Event: FT_EVENT_MODEM_STATUS ,Line Status Event: FT_EVENT_LINE_STATUS ,Removed Event: FT_EVENT_REMOVED |
static byte |
FT_EVENT_MODEM_STATUS
Event bits :
Rx Char Event: FT_EVENT_RXCHAR ,Modem Status Event: FT_EVENT_MODEM_STATUS ,Line Status Event: FT_EVENT_LINE_STATUS ,Removed Event: FT_EVENT_REMOVED |
static byte |
FT_EVENT_REMOVED
Event bits :
Rx Char Event: FT_EVENT_RXCHAR ,Modem Status Event: FT_EVENT_MODEM_STATUS ,Line Status Event: FT_EVENT_LINE_STATUS ,Removed Event: FT_EVENT_REMOVED |
static byte |
FT_EVENT_RXCHAR
Event bits :
Rx Char Event: FT_EVENT_RXCHAR ,Modem Status Event: FT_EVENT_MODEM_STATUS ,Line Status Event: FT_EVENT_LINE_STATUS ,Removed Event: FT_EVENT_REMOVED |
static byte |
FT_FE
|
static byte |
FT_FLAGS_HI_SPEED
|
static byte |
FT_FLAGS_OPENED
|
static short |
FT_FLOW_DTR_DSR
Flow Control bits :
None: FT_FLOW_NONE ,CTS/RTS: FT_FLOW_RTS_CTS ,DTR/DSR: FT_FLOW_DTR_DSR ,XON/XOFF: FT_FLOW_XON_XOFF |
static short |
FT_FLOW_NONE
Flow Control bits :
None: FT_FLOW_NONE ,CTS/RTS: FT_FLOW_RTS_CTS ,DTR/DSR: FT_FLOW_DTR_DSR ,XON/XOFF: FT_FLOW_XON_XOFF |
static short |
FT_FLOW_RTS_CTS
Flow Control bits :
None: FT_FLOW_NONE ,CTS/RTS: FT_FLOW_RTS_CTS ,DTR/DSR: FT_FLOW_DTR_DSR ,XON/XOFF: FT_FLOW_XON_XOFF |
static short |
FT_FLOW_XON_XOFF
Flow Control bits :
None: FT_FLOW_NONE ,CTS/RTS: FT_FLOW_RTS_CTS ,DTR/DSR: FT_FLOW_DTR_DSR ,XON/XOFF: FT_FLOW_XON_XOFF |
static byte |
FT_OE
|
static byte |
FT_PARITY_EVEN
Parity bits, used by App :
None: FT_PARITY_NONE ,Odd: FT_PARITY_ODD ,Even: FT_PARITY_EVEN ,Mark: FT_PARITY_MARK ,Space: FT_PARITY_SPACE |
static byte |
FT_PARITY_MARK
Parity bits, used by App :
None: FT_PARITY_NONE ,Odd: FT_PARITY_ODD ,Even: FT_PARITY_EVEN ,Mark: FT_PARITY_MARK ,Space: FT_PARITY_SPACE |
static byte |
FT_PARITY_NONE
Parity bits, used by App :
None: FT_PARITY_NONE ,Odd: FT_PARITY_ODD ,Even: FT_PARITY_EVEN ,Mark: FT_PARITY_MARK ,Space: FT_PARITY_SPACE |
static byte |
FT_PARITY_ODD
Parity bits, used by App :
None: FT_PARITY_NONE ,Odd: FT_PARITY_ODD ,Even: FT_PARITY_EVEN ,Mark: FT_PARITY_MARK ,Space: FT_PARITY_SPACE |
static byte |
FT_PARITY_SPACE
Parity bits, used by App :
None: FT_PARITY_NONE ,Odd: FT_PARITY_ODD ,Even: FT_PARITY_EVEN ,Mark: FT_PARITY_MARK ,Space: FT_PARITY_SPACE |
static byte |
FT_PE
|
static byte |
FT_PURGE_RX
|
static byte |
FT_PURGE_TX
|
static byte |
FT_RI
|
static byte |
FT_STOP_BITS_1
|
static byte |
FT_STOP_BITS_2
|
static int |
FTDI_BREAK_OFF
BREAK on is bit 14 in wValue parameter of FTDI_SET_DATA request :
UART break on condition: FTDI_BREAK_OFF ,UART break off condition: FTDI_BREAK_ON |
static int |
FTDI_BREAK_ON
BREAK on is bit 14 in wValue parameter of FTDI_SET_DATA request :
UART break on condition: FTDI_BREAK_OFF ,UART break off condition: FTDI_BREAK_ON |
Modifier and Type | Method and Description |
---|---|
int |
addUsbDevice(UsbDevice dev)
This method analyze the dev passed-in, if it's a FTDI device, add it to manageable device list
|
int |
createDeviceInfoList(Context parentContext)
This method builds an internal device information list and returns the number
of D2XX devices connected to the system.
|
int |
getDeviceInfoList(int numDevs,
D2xxManager.FtDeviceInfoListNode[] deviceList)
This method returns the device list created with a prior call to
createDeviceInfoList(Context) . |
D2xxManager.FtDeviceInfoListNode |
getDeviceInfoListDetail(int index)
This method returns information for a single device from the internal device list
created by a previous call to
createDeviceInfoList(Context) . |
static D2xxManager |
getInstance(Context parentContext)
This method initialises an application, obtaining a value of D2xx device manager.
|
static int |
getLibraryVersion()
This method returns the D2XX library version number.
|
int[][] |
getVIDPID()
This retrieves the current VID and PID combination from within the internal device list table.
|
boolean |
isFtDevice(UsbDevice dev)
This queries if a plugged-in USB device is a valid FT_Device
|
FT_Device |
openByDescription(Context parentContext,
String description)
This designates the device with the specified description.
|
FT_Device |
openByDescription(Context parentContext,
String description,
D2xxManager.DriverParameters params)
This designates the device with the specified description and allows for
configuration of driver parameters.
|
FT_Device |
openByIndex(Context parentContext,
int index)
This designates the device at the specified index.
|
FT_Device |
openByIndex(Context parentContext,
int index,
D2xxManager.DriverParameters params)
This designates the device at the specified index and allows for configuration of driver parameters.
|
FT_Device |
openByLocation(Context parentContext,
int location)
This designates the device at the specified location.
|
FT_Device |
openByLocation(Context parentContext,
int location,
D2xxManager.DriverParameters params)
This designates the device at the specified location, and allows for configuration of driver parameters.
|
FT_Device |
openBySerialNumber(Context parentContext,
String serialNumber)
This designates the device with the specified serial number.
|
FT_Device |
openBySerialNumber(Context parentContext,
String serialNumber,
D2xxManager.DriverParameters params)
This designates the device with the specified serial number for use,
and allows for configuration of driver parameters.
|
FT_Device |
openByUsbDevice(Context parentContext,
UsbDevice dev)
This designates the device from the specified USB Device object..
|
FT_Device |
openByUsbDevice(Context parentContext,
UsbDevice dev,
D2xxManager.DriverParameters params)
This designates the device from the specified USB Device object,
and allows for configuration of driver parameters.
|
boolean |
setVIDPID(int vendorId,
int productId)
This allows a custom VID and PID combination within the internal
device list table.
|
public static final byte FT_DATA_BITS_7
public static final byte FT_DATA_BITS_8
public static final byte FT_STOP_BITS_1
public static final byte FT_STOP_BITS_2
public static final byte FT_PARITY_NONE
FT_PARITY_NONE
,FT_PARITY_ODD
,FT_PARITY_EVEN
,FT_PARITY_MARK
,FT_PARITY_SPACE
public static final byte FT_PARITY_ODD
FT_PARITY_NONE
,FT_PARITY_ODD
,FT_PARITY_EVEN
,FT_PARITY_MARK
,FT_PARITY_SPACE
public static final byte FT_PARITY_EVEN
FT_PARITY_NONE
,FT_PARITY_ODD
,FT_PARITY_EVEN
,FT_PARITY_MARK
,FT_PARITY_SPACE
public static final byte FT_PARITY_MARK
FT_PARITY_NONE
,FT_PARITY_ODD
,FT_PARITY_EVEN
,FT_PARITY_MARK
,FT_PARITY_SPACE
public static final byte FT_PARITY_SPACE
FT_PARITY_NONE
,FT_PARITY_ODD
,FT_PARITY_EVEN
,FT_PARITY_MARK
,FT_PARITY_SPACE
public static final short FT_FLOW_NONE
FT_FLOW_NONE
,FT_FLOW_RTS_CTS
,FT_FLOW_DTR_DSR
,FT_FLOW_XON_XOFF
public static final short FT_FLOW_RTS_CTS
FT_FLOW_NONE
,FT_FLOW_RTS_CTS
,FT_FLOW_DTR_DSR
,FT_FLOW_XON_XOFF
public static final short FT_FLOW_DTR_DSR
FT_FLOW_NONE
,FT_FLOW_RTS_CTS
,FT_FLOW_DTR_DSR
,FT_FLOW_XON_XOFF
public static final short FT_FLOW_XON_XOFF
FT_FLOW_NONE
,FT_FLOW_RTS_CTS
,FT_FLOW_DTR_DSR
,FT_FLOW_XON_XOFF
public static final byte FT_PURGE_RX
public static final byte FT_PURGE_TX
public static final byte FT_CTS
public static final byte FT_DSR
public static final byte FT_RI
public static final byte FT_DCD
public static final byte FT_OE
public static final byte FT_PE
public static final byte FT_FE
public static final byte FT_BI
public static final byte FT_EVENT_RXCHAR
FT_EVENT_RXCHAR
,FT_EVENT_MODEM_STATUS
,FT_EVENT_LINE_STATUS
,FT_EVENT_REMOVED
public static final byte FT_EVENT_MODEM_STATUS
FT_EVENT_RXCHAR
,FT_EVENT_MODEM_STATUS
,FT_EVENT_LINE_STATUS
,FT_EVENT_REMOVED
public static final byte FT_EVENT_LINE_STATUS
FT_EVENT_RXCHAR
,FT_EVENT_MODEM_STATUS
,FT_EVENT_LINE_STATUS
,FT_EVENT_REMOVED
public static final byte FT_EVENT_REMOVED
FT_EVENT_RXCHAR
,FT_EVENT_MODEM_STATUS
,FT_EVENT_LINE_STATUS
,FT_EVENT_REMOVED
public static final byte FT_FLAGS_OPENED
public static final byte FT_FLAGS_HI_SPEED
public static final int FT_DEVICE_232B
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_8U232AM
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_UNKNOWN
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_2232
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_232R
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_245R
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_2232H
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_4232H
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_232H
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final int FT_DEVICE_X_SERIES
FT_DEVICE_232B
,FT_DEVICE_8U232AM
,FT_DEVICE_UNKNOWN
,FT_DEVICE_2232
,FT_DEVICE_232R
,FT_DEVICE_245R
,FT_DEVICE_2232H
,FT_DEVICE_4232H
,FT_DEVICE_232H
,FT_DEVICE_X_SERIES
public static final byte FT_BITMODE_RESET
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_ASYNC_BITBANG
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_MPSSE
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_SYNC_BITBANG
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_MCU_HOST
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_FAST_SERIAL
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_CBUS_BITBANG
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final byte FT_BITMODE_SYNC_FIFO
FT_BITMODE_RESET
,FT_BITMODE_ASYNC_BITBANG
,FT_BITMODE_MPSSE
,FT_BITMODE_SYNC_BITBANG
,FT_BITMODE_MCU_HOST
,FT_BITMODE_FAST_SERIAL
, FT_BITMODE_CBUS_BITBANG
, FT_BITMODE_SYNC_FIFO
public static final int FTDI_BREAK_OFF
FTDI_BREAK_OFF
,FTDI_BREAK_ON
public static final int FTDI_BREAK_ON
FTDI_BREAK_OFF
,FTDI_BREAK_ON
public boolean isFtDevice(UsbDevice dev)
dev
- The UsbDevice get from ACTION_USB_DEVICE_ATTACHED broadcast.public static D2xxManager getInstance(Context parentContext) throws D2xxManager.D2xxException
parentContext
- The calling activity must pass the application Context into this function.D2xxManager
device manager.D2xxManager.D2xxException
public boolean setVIDPID(int vendorId, int productId)
setVIDPID(int, int)
function is
a pre-requisite.
openByIndex(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)
,
openByLocation(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)
,
openBySerialNumber(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)
,
openByDescription(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)
,
createDeviceInfoList(Context)
.vendorId
- The vendor ID that the driver aligns withproductId
- The product ID that the driver aligns withpublic int[][] getVIDPID()
setVIDPID(int, int)
public int createDeviceInfoList(Context parentContext)
getDeviceInfoList(int, com.ftdi.j2xx.D2xxManager.FtDeviceInfoListNode[])
or getDeviceInfoListDetail(int)
methods.
Remarks:
An application can use this function to ascertain the number of devices attached to the system.
The application allocates space for the device information list and retrieves the list using
getDeviceInfoList(int, com.ftdi.j2xx.D2xxManager.FtDeviceInfoListNode[])
or getDeviceInfoListDetail(int)
methods.
If the devices connected to the system change, the device info list will not be updated until
createDeviceInfoList(Context)
is called again.parentContext
- The calling activity must pass the application Context into this function.getDeviceInfoList(int, com.ftdi.j2xx.D2xxManager.FtDeviceInfoListNode[])
.public int getDeviceInfoList(int numDevs, D2xxManager.FtDeviceInfoListNode[] deviceList)
createDeviceInfoList(Context)
.
The list contains all available information for all of the available devices at the
time that createDeviceInfoList(Context)
was called.
Note that the flags element of each D2xxManager.FtDeviceInfoListNode
object in the list
is a bit-mask of FT_FLAGS_OPENED
and FT_FLAGS_HI_SPEED
.
Remarks:
This function should only be called after calling createDeviceInfoList(Context)
. If the devices connected to the
system change, the device info list will not be updated until createDeviceInfoList(Context)
is called again.
Location ID information is not returned for devices that are open when createDeviceInfoList(Context)
is called.
Information is not available for devices which are open in other processes. The Flags parameter of the
FT_FLAGS_OPENED
indicate that the device is open, but other fields will
be unpopulated.numDevs
- The number of devices represented in the device information
list.deviceList
- An array of D2xxManager.FtDeviceInfoListNode
. That contains information
on all available devices after a successful call..getDeviceInfoList(int, com.ftdi.j2xx.D2xxManager.FtDeviceInfoListNode[])
call.public D2xxManager.FtDeviceInfoListNode getDeviceInfoListDetail(int index)
createDeviceInfoList(Context)
.
The flags element of the D2xxManager.FtDeviceInfoListNode
object is a bit-mask of
FT_FLAGS_OPENED
and FT_FLAGS_HI_SPEED
.
NOTE:This function is to be called after calling createDeviceInfoList(Context)
.
The device info list is not updated where changes are made to the
connected devices until createDeviceInfoList(Context)
is called again.
The index value is zero-based.index
- An index of the information pertaining to the devices in the list.D2xxManager.FtDeviceInfoListNode
object containing the information
available for the device specified index in the list. NULL for error.public static int getLibraryVersion()
public FT_Device openByUsbDevice(Context parentContext, UsbDevice dev, D2xxManager.DriverParameters params)
parentContext
- The calling activity must pass the application Context into this function.dev
- The USB Device object as an FT_DeviceDriverParameters
- Parameters to configure max transfer size, buffer size, Rx timeout and number of
buffers.
Buffer size : the default is 16k , Max is 16k , Min is 64.
Packet size : the default is 16384 , Max is 16384 , Min is 64.
Buffer Number : the default is 16 , Max is 16 , Min is 2.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByUsbDevice(Context parentContext, UsbDevice dev)
parentContext
- The calling activity must pass the application Context into this function.dev
- The USB Device object as an FT_DeviceFT_Device
object containing the device object, NULL for errorpublic FT_Device openByIndex(Context parentContext, int index, D2xxManager.DriverParameters params)
parentContext
- The calling activity must pass the application Context into this function.index
- The index of the device, which is 0 based..DriverParameters
- Parameters to configure max transfer size, buffer size, Rx timeout and number of buffers.
Buffer size : the default is 16k , Max is 16k , Min is 64.
Packet size : the default is 16384 , Max is 16384 , Min is 64.
Buffer Number : the default is 16 , Max is 16 , Min is 2.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByIndex(Context parentContext, int index)
parentContext
- The calling activity must pass the application Context into this function.index
- The index of the device, which is 0 based..FT_Device
object containing the device object, NULL for errorpublic FT_Device openBySerialNumber(Context parentContext, String serialNumber, D2xxManager.DriverParameters params)
parentContext
- The calling activity must pass the application Context into this function.serialNumber
- The serial number of the device.DriverParameters
- Parameters to configure max transfer size, buffer size, Rx timeout and number of
buffers.
Buffer size : the default is 16k , Max is 16k , Min is 64.
Packet size : the default is 16384 , Max is 16384 , Min is 64.
Buffer Number : the default is 16 , Max is 16 , Min is 2.FT_Device
object containing the device object, NULL for errorpublic FT_Device openBySerialNumber(Context parentContext, String serialNumber)
parentContext
- The calling activity must pass the application Context into this function.serialNumber
- The serial number of the device.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByDescription(Context parentContext, String description, D2xxManager.DriverParameters params)
parentContext
- The calling activity must pass the application Context into this function..description
- Description of the device.DriverParameters
- Parameters to configure max transfer size, buffer size, Rx timeout and number of
buffers.
Buffer size : the default is 16k , Max is 16k , Min is 64.
Packet size : the default is 16384 , Max is 16384 , Min is 64.
Buffer Number : the default is 16 , Max is 16 , Min is 2.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByDescription(Context parentContext, String description)
parentContext
- The calling activity must pass the application Context into this function.description
- Description of the device.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByLocation(Context parentContext, int location, D2xxManager.DriverParameters params)
parentContext
- The calling activity must pass the application Context into this function.location
- The location of the device.DriverParameters
- Parameters to configure max packet size, buffer size, Rx timeout and number of
buffers.
Buffer size : the default is 16k , Max is 16k , Min is 64.
Packet size : the default is 16384 , Max is 16384 , Min is 64.
Buffer Number : the default is 16 , Max is 16 , Min is 2.FT_Device
object containing the device object, NULL for errorpublic FT_Device openByLocation(Context parentContext, int location)
parentContext
- The calling activity must pass the application Context into this function.location
- The location of the device.FT_Device
object containing the device object, NULL for errorpublic int addUsbDevice(UsbDevice dev)
dev
- The UsbDevice obtained from Android USB API or Broadcast message