public class FTDevice extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close connection with device.
|
void |
cyclePort()
Send a cycle command to the USB port.
|
boolean |
equals(Object obj) |
protected void |
finalize() |
BitModes |
getBitMode()
Gets the instantaneous value of the data bus.
|
int |
getComPortNumber()
Gets the com port number of the device.
|
String |
getDevDescription()
Get device description.
|
static List<FTDevice> |
getDevices()
Get the connected FTDI devices.
|
static List<FTDevice> |
getDevices(boolean isIncludeOpenedDevices)
Get the connected FTDI devices.
|
static List<FTDevice> |
getDevicesByDescription(String description)
Get the connected FTDI devices.
|
static List<FTDevice> |
getDevicesByDeviceType(DeviceType deviceType)
Get the connected FTDI devices.
|
static List<FTDevice> |
getDevicesBySerialNumber(String serialNumber)
Get the connected FTDI devices.
|
EnumSet<DeviceStatus> |
getDeviceStatus()
Gets the modem status and line status from the device.
|
int |
getDevID()
Get device ID.
|
int |
getDevLocationID()
Get device location.
|
String |
getDevSerialNumber()
Get device serial number.
|
DeviceType |
getDevType()
Get device type.
|
int |
getEEPROMUserAreaSize()
Get the available size of the EEPROM user area
|
int |
getFlag()
Get device flag.
|
InputStream |
getInputStream()
Get an InputStream to device.
|
short |
getLatencyTimer()
Get the current value of the latency timer.
|
OutputStream |
getOutputStream()
Get an OutputStream to device.
|
int |
getQueueStatus()
Gets the number of bytes in the receive queue.
|
int |
hashCode() |
boolean |
isInUse()
determines if the device is in use by anybody
|
boolean |
isOpen()
determines if the device was opened already
|
void |
open()
Open connection with device.
|
void |
purgeBuffer(boolean rxBuffer,
boolean txBuffer)
Purge receive or transmit buffers in the device.
|
int |
read()
Read a byte from device.
|
int |
read(byte[] bytes)
Read bytes from device.
|
int |
read(byte[] bytes,
int offset,
int lenght)
Read bytes from device.
|
byte[] |
read(int number)
Read given bytes from device.
|
EepromX |
readEEPROM_X()
Read X series device EEPROM data Check D2xx Programmer's Guide Appendix A for details
|
EEPROMData |
readEEPROM()
Read device EEPROM data
|
byte[] |
readEEPROMUserArea(int numberOfBytes)
Read the contents of the EEPROM user area
|
byte[] |
readFullEEPROMUserArea()
Read all contents of the EEPROM user area
|
String |
readFullEEPROMUserAreaAsString()
Read all contents of the EEPROM user area as String
|
void |
resetDevice()
Send a reset command to the device.
|
void |
setBaudRate(long baudRate)
Set desired baud rate.
|
void |
setBitMode(byte ucMask,
BitModes bitMode)
Enables different chip modes.
|
void |
setDataCharacteristics(WordLength wordLength,
StopBits stopBits,
Parity parity)
This function sets the data characteristics for the device
|
void |
setDtr(boolean status)
Set the Data Terminal Ready (DTR) control signal.
|
void |
SetEventNotification(com.sun.jna.Pointer eventHandler)
Set the event notification handler.
|
void |
setFlowControl(FlowControl flowControl)
Sets the flow control for the device.
|
void |
setFlowControl(FlowControl flowControl,
byte uXon,
byte uXoff)
Sets the flow control for the device.
|
void |
setLatencyTimer(short timer)
Set the latency timer value.
|
void |
setRts(boolean status)
Set the Request To Send (RTS) control signal
|
void |
setTimeouts(long readTimeout,
long writeTimeout)
Set the read and write timeouts for the device.
|
void |
setUSBParameters(int inTransferSize,
int outTransferSize)
Set the USB request transfer size.
|
static void |
setVidPid(int dwVID,
int dwPID)
A command to include a custom VID and PID combination within the internal device list table.
|
String |
toString() |
int |
write(byte[] bytes)
Write bytes to device.
|
int |
write(byte[] bytes,
int offset,
int length)
Write bytes to device.
|
boolean |
write(int b)
Write byte to device.
|
void |
writeEEPROM_X(EepromX eeprom)
Write X series device EEPROM data Check D2xx Programmer's Guide Appendix A for details
|
void |
writeEEPROM(EEPROMData programData)
Program the EEPROM data
|
void |
writeEEPROMUserArea(byte[] data)
Write data into the EEPROM user area
|
void |
writeEEPROMUserArea(String data)
Write string into the EEPROM user area
|
public String getDevDescription()
public int getDevID()
public String getDevSerialNumber()
public DeviceType getDevType()
public int getDevLocationID()
public int getFlag()
public boolean isInUse()
true if the device is in use by anybody, false otherwisepublic boolean isOpen()
public static void setVidPid(int dwVID,
int dwPID)
throws FTD2XXException
dwVID - Device Vendor ID (VID)dwPID - Device Product ID (PID)FTD2XXException - If something goes wrong.public static List<FTDevice> getDevices() throws FTD2XXException
FTD2XXException - If something goes wrong.public static List<FTDevice> getDevices(boolean isIncludeOpenedDevices) throws FTD2XXException
isIncludeOpenedDevices - Would you like to see opened devices?FTD2XXException - If something goes wrong.public static List<FTDevice> getDevicesByDescription(String description) throws FTD2XXException
description - Filtering option, exact match need.FTD2XXException - If something goes wrong.public static List<FTDevice> getDevicesBySerialNumber(String serialNumber) throws FTD2XXException
serialNumber - Filtering option, exact match need.FTD2XXException - If something goes wrong.public static List<FTDevice> getDevicesByDeviceType(DeviceType deviceType) throws FTD2XXException
deviceType - Filtering option.FTD2XXException - If something goes wrong.public void open()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void close()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void cyclePort()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void setBaudRate(long baudRate)
throws FTD2XXException
baudRate - The baud rate.FTD2XXException - If something goes wrong.public void setDataCharacteristics(WordLength wordLength, StopBits stopBits, Parity parity) throws FTD2XXException
wordLength - Number of bits per wordstopBits - Number of stop bitsparity - ParityFTD2XXException - If something goes wrong.public void setTimeouts(long readTimeout,
long writeTimeout)
throws FTD2XXException
readTimeout - Read timeout in milliseconds.writeTimeout - Write timeout in milliseconds.FTD2XXException - If something goes wrong.public void setFlowControl(FlowControl flowControl) throws FTD2XXException
flowControl - Flow control type.FTD2XXException - If something goes wrong.public void setFlowControl(FlowControl flowControl, byte uXon, byte uXoff) throws FTD2XXException
flowControl - Flow control type.uXon - Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFFuXoff - Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFFFTD2XXException - If something goes wrong.public void setDtr(boolean status)
throws FTD2XXException
status - Status of DTR signal.FTD2XXException - If something goes wrong.public void setRts(boolean status)
throws FTD2XXException
status - Status of RTS signal.FTD2XXException - If something goes wrong.public EnumSet<DeviceStatus> getDeviceStatus() throws FTD2XXException
FTD2XXException - If something goes wrong.public int getQueueStatus()
throws FTD2XXException
FTD2XXException - If something goes wrong.public int getComPortNumber()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void SetEventNotification(com.sun.jna.Pointer eventHandler)
throws FTD2XXException
eventHandler - The event handlerFTD2XXException - If something goes wrong.public void purgeBuffer(boolean rxBuffer,
boolean txBuffer)
throws FTD2XXException
rxBuffer - Will rxBuffer be purged?txBuffer - Will txBuffer be purged?FTD2XXException - If something goes wrong.public void resetDevice()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void setLatencyTimer(short timer)
throws FTD2XXException,
IllegalArgumentException
timer - Latency timer value in milliseconds. Valid range is 2 - 255.FTD2XXException - If something goes wrong.IllegalArgumentException - If timer was not in range 2 - 255.public short getLatencyTimer()
throws FTD2XXException
FTD2XXException - If something goes wrong.public void setBitMode(byte ucMask,
BitModes bitMode)
throws FTD2XXException
ucMask - Required value for bit mode mask. This sets up which bits are inputs and outputs. A bit value of 0
sets the corresponding pin to an input, a bit value of 1 sets the corresponding pin to an output. In
the case of CBUS Bit Bang, the upper nibble of this value controls which pins are inputs and outputs,
while the lower nibble controls which of the outputs are high and low.bitMode - Mode value.FTD2XXException - If something goes wrong.public BitModes getBitMode() throws FTD2XXException
FTD2XXException - If something goes wrong.public void setUSBParameters(int inTransferSize,
int outTransferSize)
throws FTD2XXException
inTransferSize - Transfer size for USB IN requestoutTransferSize - Transfer size for USB OUT requestFTD2XXException - If something goes wrong.public void writeEEPROM(EEPROMData programData) throws FTD2XXException
programData - EEPROM to programFTD2XXException - If something goes wrong.public EEPROMData readEEPROM() throws FTD2XXException
FTD2XXException - If something goes wrong.public EepromX readEEPROM_X() throws FTD2XXException
FTD2XXException - If something goes wrong.public void writeEEPROM_X(EepromX eeprom) throws FTD2XXException
eeprom - dataFTD2XXException - If something goes wrong.public int getEEPROMUserAreaSize()
throws FTD2XXException
FTD2XXException - If something goes wrong.public byte[] readEEPROMUserArea(int numberOfBytes)
throws FTD2XXException
numberOfBytes - Size in bytes, to be readFTD2XXException - If something goes wrong.public byte[] readFullEEPROMUserArea()
throws FTD2XXException
FTD2XXException - If something goes wrong.public String readFullEEPROMUserAreaAsString() throws IOException
FTD2XXException - If something goes wrong.IOExceptionpublic void writeEEPROMUserArea(byte[] data)
throws FTD2XXException
data - byte[] to writeFTD2XXException - If something goes wrong.public void writeEEPROMUserArea(String data) throws FTD2XXException
data - byte[] to writeFTD2XXException - If something goes wrong.public int write(byte[] bytes,
int offset,
int length)
throws FTD2XXException
bytes - Byte array to sendoffset - Start indexlength - Amount of bytes to writeFTD2XXException - If something goes wrong.public int write(byte[] bytes)
throws FTD2XXException
bytes - Byte array to sendFTD2XXException - If something goes wrong.public boolean write(int b)
throws FTD2XXException
b - Byte to send (0..255)FTD2XXExceptionpublic int read(byte[] bytes,
int offset,
int lenght)
throws FTD2XXException
bytes - Bytes array to store read bytesoffset - Start index.lenght - Amount of bytes to readFTD2XXException - If something goes wrong.public int read(byte[] bytes)
throws FTD2XXException
bytes - Bytes array to store read bytesFTD2XXException - If something goes wrong.public int read()
throws FTD2XXException
FTD2XXExceptionpublic byte[] read(int number)
throws FTD2XXException
number - How many bytes do you want to read?FTD2XXException - If something goes wrong.public InputStream getInputStream()
public OutputStream getOutputStream()
Copyright © 2021. All rights reserved.