FT_Device

com.ftdi.j2xx

## Class FT_Device

- java.lang.Object
- - com.ftdi.j2xx.FT_Device

-     public class FT_Device
      extends java.lang.Object

  A device class provide different APIs for host to communicate and operate different FT device. Use `D2xxManager.getInstance(Context)` to get a copy of D2xxManager first; use `D2xxManager.createDeviceInfoList(Context)` method to scan current connected FTDI devices, then open target device to get FT_Device instance via a suitable open API.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FT_Device(Context parentContext, UsbManager usbManager, UsbDevice dev, UsbInterface itf)` FT_Device constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes a device opened with a previous call to `D2xxManager.openByIndex(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)`, `D2xxManager.openBySerialNumber(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)`, `D2xxManager.openByDescription(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)` or `D2xxManager.openByLocation(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)`.
    `boolean` | `clrDtr()` Allows the DTR modem control line to be manually de-asserted.
    `boolean` | `clrRts()` Allows the RTS modem control line to be manually de-asserted.
    `boolean` | `eepromErase()` Erases the device EEPROM.
    `int` | `eepromGetUserAreaSize()` Retrieves the amount of additional space available in the device EEPROM.
    `FT_EEPROM` | `eepromRead()` This method reads the entire device EEPROM and decodes its settings in to fields in a `FT_EEPROM` object. remarks: `FT_EEPROM` : For FT_232A , FT_232B. `FT_EEPROM_2232H` : For FT_2232H. `FT_EEPROM_2232D` : For FT_2232. `FT_EEPROM_4232H` : For FT_4232H. `FT_EEPROM_232R` : For FT_232R. `FT_EEPROM_245R` : For FT_245R. `FT_EEPROM_232H` : For FT_232H. `FT_EEPROM_X` : For FT_X_Series.
    `byte[]` | `eepromReadUserArea(int length)` Retrieves the contents of the device EEPROM user area.
    `int` | `eepromReadWord(short offset)` This method reads a WORD from the device EEPROM at the specified address.
    `short` | `eepromWrite(FT_EEPROM eeData)` This method encodes the settings from a `FT_EEPROM` object and writes them to the device EEPROM. remarks: `FT_EEPROM` : For FT_232A , FT_232B. `FT_EEPROM_2232H` : For FT_2232H. `FT_EEPROM_2232D` : For FT_2232. `FT_EEPROM_4232H` : For FT_4232H. `FT_EEPROM_232R` : For FT_232R. `FT_EEPROM_245R` : For FT_245R. `FT_EEPROM_232H` : For FT_232H. `FT_EEPROM_X` : For FT_X_Series.
    `int` | `eepromWriteUserArea(byte[] data)` Writes data to the device EEPROM user area.
    `boolean` | `eepromWriteWord(short address, short data)` This method writes a WORD to the device EEPROM at the specified address.
    `byte` | `getBitMode()` Gets the instantaneous value of the data bus. Remarks: For a description of available bit modes for the FT232R, see the application note "Bit Bang Modes for the FT232R and FT245R". For a description of available bit modes for the FT2232, see the application note "Bit Mode Functions for the FT2232".
    `D2xxManager.FtDeviceInfoListNode` | `getDeviceInfo()` Retrieves information on the device that is currently open.
    `long` | `getEventStatus()` This method retrieves the event status
    `byte` | `getLatencyTimer()` This method retrieves the current latency timer value from the device.
    `short` | `getLineStatus()` This method retrieves the current modem line status values for the device.
    `short` | `getModemStatus()` Retrieves the current modem status values for the device.
    `int` | `getQueueStatus()` Retrieves the number of bytes available to read from the driver Rx buffer.
    `int` | `getReadTimeout()`
    `boolean` | `isOpen()` Returns the open status of the device.
    `boolean` | `purge(byte flags)` Discards any data form the specified driver buffer and also flushes data from the device.
    `int` | `read(byte[] data)` This method reads data from the device in to the Java application buffer.
    `int` | `read(byte[] data, int length)` This method reads data from the device in to the Java application buffer.
    `int` | `read(byte[] data, int length, long wait_ms)` This method reads data from the device in to the Java application buffer.
    `boolean` | `readBufferFull()` This method return if the Rx buffer was full with data, if true, Rx would be pending until the data is read by user.
    `boolean` | `resetDevice()` This method sends a vendor command to the device to cause a reset and flush any data from the device buffers.
    `void` | `restartInTask()` Restarts the driver's IN thread following a successful call to `stopInTask()` Remarks: This function is used to restart the driver's IN task (read) after it has been stopped by a call to `stopInTask()`.
    `boolean` | `setBaudRate(int baudRate)` This method sends a vendor command to the device to change the baud rate generator value.
    `boolean` | `setBitMode(byte mask, byte bitMode)` This method allows the device to use alternative interface modes such as bit-bang, MPSSE and CPU target mode.
    `boolean` | `setBreakOff()` This method resets the BREAK condition on the device UART.
    `boolean` | `setBreakOn()` This method generates a BREAK condition on the device UART.
    `boolean` | `setChars(byte eventChar, byte eventCharEnable, byte errorChar, byte errorCharEnable)` Specifies the event character and error replacement characters for the device to use.
    `boolean` | `setDataCharacteristics(byte dataBits, byte stopBits, byte parity)` This method dictates the data format that the device will use.
    `boolean` | `setDtr()` Allows the DTR modem control line to be manually asserted.
    `boolean` | `setEventNotification(long Mask)` This method specifies events for the java driver to signal that they have occurred.
    `boolean` | `setFlowControl(short flowControl, byte xon, byte xoff)` Specifies the flow control method that the device should use to prevent data loss.
    `boolean` | `setLatencyTimer(byte latency)` This method allows the latency timer value for the device to be specified.
    `boolean` | `setRts()` Allows the RTS modem control line to be manually asserted.
    `void` | `stopInTask()` This method stops the driver's IN thread and prevents USB IN requests being issued to the device.
    `boolean` | `stoppedInTask()` This method return the running status of starts the driver's IN thread.
    `int` | `VendorCmdGet(int request, int wValue, byte[] buf, int datalen)` This API is used to send vendor command to get data
    `int` | `VendorCmdSet(int request, int wValue)` This API is used to send vendor command to send data
    `int` | `VendorCmdSet(int request, int wValue, byte[] buf, int datalen)` This API is used to send vendor command to send data
    `int` | `write(byte[] data)` This method writes data to the device from the Java application buffer.
    `int` | `write(byte[] data, int length)` This method writes data to the device from the Java application buffer.
    `int` | `write(byte[] data, int length, boolean wait)` This method writes data to the device from the Java application buffer.

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

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

- - ### Constructor Detail

    - #### FT_Device

          public FT_Device(Context parentContext,
                   UsbManager usbManager,
                   UsbDevice dev,
                   UsbInterface itf)

      FT_Device constructor

  - ### Method Detail

    - #### getReadTimeout

          public int getReadTimeout()

    - #### isOpen

          public boolean isOpen()

      Returns the open status of the device.
      Returns:
        boolean Returns true if the device is open, false otherwise.

    - #### close

          public void close()

      Closes a device opened with a previous call to `D2xxManager.openByIndex(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)`, `D2xxManager.openBySerialNumber(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)`, `D2xxManager.openByDescription(Context, java.lang.String, com.ftdi.j2xx.D2xxManager.DriverParameters)` or `D2xxManager.openByLocation(Context, int, com.ftdi.j2xx.D2xxManager.DriverParameters)`.

    - #### getDeviceInfo

          public D2xxManager.FtDeviceInfoListNode getDeviceInfo()

      Retrieves information on the device that is currently open.
      Returns:
        A `D2xxManager.FtDeviceInfoListNode` object containing the information available for the device. Note that the flags and location fields are not used by this method.

    - #### read

          public int read(byte[] data,
                 int length,
                 long wait_ms)

      This method reads data from the device in to the Java application buffer. The device must be open to read data from it. This method allows user to specify a custom read timeout value in milliseconds unit.
      Parameters:
        `data` - A data buffer containing the bytes read from the device.
        `length` - The number of bytes that the application is requesting to be read from the device.
        `wait_ms` - A custom wait timeout value in ms.
      Returns:
        The number of bytes successfully read from the device.

    - #### read

          public int read(byte[] data,
                 int length)

      This method reads data from the device in to the Java application buffer. The device must be open to read data from it.
      Parameters:
        `data` - A data buffer containing the bytes read from the device.
        `length` - The number of bytes that the application is requesting to be read from the device.
      Returns:
        The number of bytes successfully read from the device.

    - #### read

          public int read(byte[] data)

      This method reads data from the device in to the Java application buffer. The device must be open to read data from it. Will attempt to read data.length bytes from the device.
      Parameters:
        `data` - A data buffer containing the bytes read from the device.
      Returns:
        The number of bytes successfully read from the device.

    - #### write

          public int write(byte[] data,
                  int length)

      This method writes data to the device from the Java application buffer. The device must be open to write data to it. This method will wait until USB request sent, then report how many bytes written.
      Parameters:
        `data` - A data buffer containing the bytes to write to the device.
        `length` - The number of bytes that the application is requesting to write to the device.
      Returns:
        The number of bytes successfully written to the device.

    - #### write

          public int write(byte[] data,
                  int length,
                  boolean wait)

      This method writes data to the device from the Java application buffer. The device must be open to write data to it. This method allows user to specify if one would like to wait for request sent.
      Parameters:
        `data` - A data buffer containing the bytes to write to the device.
        `length` - The number of bytes that the application is requesting to write to the device.
        `wait` - Should I wait until request sent?
      Returns:
        The number of bytes successfully written to the device.

    - #### write

          public int write(byte[] data)

      This method writes data to the device from the Java application buffer. The device must be open to write data to it. This method will wait until USB request sent, then report how many bytes written.
      Parameters:
        `data` - A data buffer containing the bytes to write to the device.
      Returns:
        The number of bytes successfully written to the device.

    - #### getModemStatus

          public short getModemStatus()

      Retrieves the current modem status values for the device. NOTE: this is only meaningful when the device is in UART mode.
      Returns:
        A short value containing the modem status. The modem status is a bit-mask of `D2xxManager.FT_CTS`, `D2xxManager.FT_DSR`, `D2xxManager.FT_RI` and `D2xxManager.FT_DCD`. Negative value for error.

    - #### getLineStatus

          public short getLineStatus()

      This method retrieves the current modem line status values for the device. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        A short value containing the line status. The line status is a bit-mask of `D2xxManager.FT_OE`, `D2xxManager.FT_PE`, `D2xxManager.FT_FE` and `D2xxManager.FT_BI`. Negative value for error.

    - #### getQueueStatus

          public int getQueueStatus()

      Retrieves the number of bytes available to read from the driver Rx buffer.
      Returns:
        The number of bytes available in the driver Rx buffer. A call to `read(byte[], int, long)` requesting up to this number of bytes will return with the data immediately. Return negative number for error.

    - #### readBufferFull

          public boolean readBufferFull()

      This method return if the Rx buffer was full with data, if true, Rx would be pending until the data is read by user.
      Returns:
        true if Rx buffer is full.

    - #### getEventStatus

          public long getEventStatus()

      This method retrieves the event status
      Returns:
        The event status, negative for error

    - #### setBaudRate

          public boolean setBaudRate(int baudRate)

      This method sends a vendor command to the device to change the baud rate generator value. Note that the baud rate is only meaningful when the device is in UART or bit-bang mode.
      Parameters:
        `baudRate` - The baud rate value to set for the device. This must be a value >184 baud. The maximum baud rate for full speed devices is 3Mbaud, for hi-speed devices it is 12Mbaud.
      Returns:
        Return true mean success.

    - #### setDataCharacteristics

          public boolean setDataCharacteristics(byte dataBits,
                                       byte stopBits,
                                       byte parity)

      This method dictates the data format that the device will use. Communication errors will occur if these parameters do not match those used by the external system Note that these data characteristics are only meaningful when the device is in UART mode.
      Parameters:
        `dataBits` - Valid data bit values are `D2xxManager.FT_DATA_BITS_7` or `D2xxManager.FT_DATA_BITS_8`.
        `stopBits` - Valid stop bit values are `D2xxManager.FT_STOP_BITS_1` or `D2xxManager.FT_STOP_BITS_2`.
        `parity` - Valid parity values are `D2xxManager.FT_PARITY_NONE`, `D2xxManager.FT_PARITY_ODD`, `D2xxManager.FT_PARITY_EVEN`, `D2xxManager.FT_PARITY_MARK` or `D2xxManager.FT_PARITY_SPACE`.
      Returns:
        Return true mean success.

    - #### setBreakOn

          public boolean setBreakOn()

      This method generates a BREAK condition on the device UART. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### setBreakOff

          public boolean setBreakOff()

      This method resets the BREAK condition on the device UART. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### setFlowControl

          public boolean setFlowControl(short flowControl,
                               byte xon,
                               byte xoff)

      Specifies the flow control method that the device should use to prevent data loss.
      Parameters:
        `flowControl` - Valid flow control values are `D2xxManager.FT_FLOW_NONE`, `D2xxManager.FT_FLOW_RTS_CTS`, `D2xxManager.FT_FLOW_DTR_DSR` or `D2xxManager.FT_FLOW_XON_XOFF`.
        `xon` - Specifies the character to use for XOn if `D2xxManager.FT_FLOW_XON_XOFF` is enabled.
        `xoff` - Specifies the character to use for XOff if `D2xxManager.FT_FLOW_XON_XOFF` is enabled.
      Returns:
        Return true mean success.

    - #### setRts

          public boolean setRts()

      Allows the RTS modem control line to be manually asserted. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### clrRts

          public boolean clrRts()

      Allows the RTS modem control line to be manually de-asserted. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### setDtr

          public boolean setDtr()

      Allows the DTR modem control line to be manually asserted. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### clrDtr

          public boolean clrDtr()

      Allows the DTR modem control line to be manually de-asserted. Note that this method is only meaningful when the device is in UART mode.
      Returns:
        Return true mean success.

    - #### setChars

          public boolean setChars(byte eventChar,
                         byte eventCharEnable,
                         byte errorChar,
                         byte errorCharEnable)

      Specifies the event character and error replacement characters for the device to use. When the device detects an event character being received, this will trigger an IN to the USB Host regardless of the number of bytes in the device's buffer or the latency timer value. When the device detects an error (`D2xxManager.FT_OE`, `D2xxManager.FT_PE`, `D2xxManager.FT_FE` or `D2xxManager.FT_BI`), the error character will be inserted in to the data stream to the USB host.
      Parameters:
        `eventChar` - The character for which the device to trigger an IN.
        `eventCharEnable` - Enable or disable the use of the event character.
        `errorChar` - The character that will be inserted in the data stream on the detection of an error.
        `errorCharEnable` - Enable or disable the use of the error replacement character.
      Returns:
        Return 0 mean success.

    - #### setBitMode

          public boolean setBitMode(byte mask,
                           byte bitMode)

      This method allows the device to use alternative interface modes such as bit-bang, MPSSE and CPU target mode. Note that not all modes are available on all devices; please consult the device data sheet for more information. Remarks: For a description of available bit modes for the FT232R, see the application note "Bit Bang Modes for the FT232R and FT245R". For a description of available bit modes for the FT2232, see the application note "Bit Mode Functions for the FT2232". For a description of Bit Bang Mode for the FT232B and FT245B, see the application note "FT232B/FT245B Bit Bang Mode". Application notes are available for download from the FTDI website. Note that to use CBUS Bit Bang for the FT232R, the CBUS must be configured for CBUS Bit Bang in the EEPROM. Note that to use Single Channel Synchronous 245 FIFO mode for the FT2232H, channel A must be configured for FT245 FIFO mode in the EEPROM.
      Parameters:
        `mask` - Bit-mask that specifies which pins are input (0) and which are output (1). Required for bit-bang modes. 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` - The desired device mode. This can be one of the following: `D2xxManager.FT_BITMODE_RESET`, `D2xxManager.FT_BITMODE_ASYNC_BITBANG`, `D2xxManager.FT_BITMODE_MPSSE`, `D2xxManager.FT_BITMODE_SYNC_BITBANG`, `D2xxManager.FT_BITMODE_MCU_HOST`, `D2xxManager.FT_BITMODE_FAST_SERIAL`, `D2xxManager.FT_BITMODE_CBUS_BITBANG` or `D2xxManager.FT_BITMODE_SYNC_FIFO`.
      Returns:
        Return true mean success.

    - #### getBitMode

          public byte getBitMode()

      Gets the instantaneous value of the data bus. Remarks: For a description of available bit modes for the FT232R, see the application note "Bit Bang Modes for the FT232R and FT245R". For a description of available bit modes for the FT2232, see the application note "Bit Mode Functions for the FT2232". For a description of bit bang modes for the FT232B and FT245B, see the application note "FT232B/FT245B Bit Bang Mode". For a description of bit modes supported by the FT4232H and FT2232H devices, please see the IC data sheets. These application notes are available for download from the FTDI website.
      Returns:
        The value read from the device pins. Negtive value for error

    - #### resetDevice

          public boolean resetDevice()

      This method sends a vendor command to the device to cause a reset and flush any data from the device buffers.
      Returns:
        Return true mean success.

    - #### VendorCmdSet

          public int VendorCmdSet(int request,
                         int wValue)

      This API is used to send vendor command to send data
      Parameters:
        `request` - Request ID
        `wValue` - Value field(two bytes)
      Returns:
        Zero for success, or negative value for failure

    - #### VendorCmdSet

          public int VendorCmdSet(int request,
                         int wValue,
                         byte[] buf,
                         int datalen)

      This API is used to send vendor command to send data
      Parameters:
        `request` - Request ID
        `wValue` - Value field(two bytes)
        `buf` - A data buffer containing the bytes write to the device.
        `datalen` - The length of the data to send
      Returns:
        The value indicates the length of data transferred (or zero) for success, or negative value for failure

    - #### VendorCmdGet

          public int VendorCmdGet(int request,
                         int wValue,
                         byte[] buf,
                         int datalen)

      This API is used to send vendor command to get data
      Parameters:
        `request` - Request ID
        `wValue` - Value field(two bytes)
        `buf` - A data buffer containing the bytes read from the device.
        `datalen` - The length of the data to receive
      Returns:
        The value indicates the length of data transferred (or zero) for success, or negative value for failure

    - #### stopInTask

          public void stopInTask()

      This method stops the driver's IN thread and prevents USB IN requests being issued to the device. No data will be received from the device if the IN thread is stopped. Remarks: This function is used to put the driver's IN task (read) into a wait state. It can be used in situations where data is being received continuously, so that the device can be purged without more data being received. It is used together with `restartInTask()` which sets the IN task running again.

    - #### restartInTask

          public void restartInTask()

      Restarts the driver's IN thread following a successful call to `stopInTask()` Remarks: This function is used to restart the driver's IN task (read) after it has been stopped by a call to `stopInTask()`.

    - #### stoppedInTask

          public boolean stoppedInTask()

      This method return the running status of starts the driver's IN thread. Remarks: This function is used to query the driver's IN task status.
      Returns:
        Return true mean driver's IN task is pause state, false mean driver's IN task is not paused.

    - #### purge

          public boolean purge(byte flags)

      Discards any data form the specified driver buffer and also flushes data from the device.
      Parameters:
        `flags` - Specifies the queue to purge. flags is a bit-mask of `D2xxManager.FT_PURGE_RX` and `D2xxManager.FT_PURGE_TX`.
      Returns:
        Return true mean success.

    - #### setLatencyTimer

          public boolean setLatencyTimer(byte latency)

      This method allows the latency timer value for the device to be specified. The latency timer is the mechanism that returns short packets to the USB host. The default value is 16ms. Remarks: In the FT8U232AM and FT8U245AM devices, the receive buffer timeout that is used to flush remaining data from the receive buffer was fixed at 16 ms. In all other FTDI devices, this timeout is programmable and can be set at 1 ms intervals between 2ms and 255 ms. This allows the device to be better optimized for protocols requiring faster response times from short data packets.
      Parameters:
        `latency` - The new value to use for the latency timer. The valid range for this is 2ms - 255ms.
      Returns:
        Return true mean success.

    - #### getLatencyTimer

          public byte getLatencyTimer()

      This method retrieves the current latency timer value from the device. The latency timer is the mechanism that returns short packets to the USB host. The default value is 16ms. Remarks: In the FT8U232AM and FT8U245AM devices, the receive buffer timeout that is used to flush remaining data from the receive buffer was fixed at 16 ms. In all other FTDI devices, this timeout is programmable and can be set at 1 ms intervals between 2ms and 255 ms. This allows the device to be better optimized for protocols requiring faster response times from short data packets.
      Returns:
        The current latency timer value. Negative value for error.

    - #### setEventNotification

          public boolean setEventNotification(long Mask)

      This method specifies events for the java driver to signal that they have occurred. Once the event mask has been set. Remarks: An application can use this function to setup conditions which allow a thread to block until one of the conditions is met. Typically, an application will create an event, call this function, then block on the event. When the conditions are met, the event is set, and the application thread unblocked. mask is a bit-map that describes the events the application is interested in. If one of the event conditions is met, the event is set. If FT_EVENT_RXCHAR is set in mask, the event will be set when a character has been received by the device. If FT_EVENT_MODEM_STATUS is set in mask, the event will be set when a change in the modem signals has been detected by the device. If FT_EVENT_LINE_STATUS is set in mask, the event will be set when a change in the line status has been detected by the device.
      Parameters:
        `mask` - Specifies the events to wait on. This is a bit-mask of `D2xxManager.FT_EVENT_RXCHAR`, `D2xxManager.FT_EVENT_MODEM_STATUS` and `D2xxManager.FT_EVENT_LINE_STATUS`.
      Returns:
        Return the event number.

    - #### eepromRead

          public FT_EEPROM eepromRead()

      This method reads the entire device EEPROM and decodes its settings in to fields in a `FT_EEPROM` object. remarks: `FT_EEPROM` : For FT_232A , FT_232B. `FT_EEPROM_2232H` : For FT_2232H. `FT_EEPROM_2232D` : For FT_2232. `FT_EEPROM_4232H` : For FT_4232H. `FT_EEPROM_232R` : For FT_232R. `FT_EEPROM_245R` : For FT_245R. `FT_EEPROM_232H` : For FT_232H. `FT_EEPROM_X` : For FT_X_Series.
      Returns:
        A `FT_EEPROM` object containing the parsed EEPROM settings for the device. NULL for error. FT_EEPROM can be cast to a actual device type.

    - #### eepromWrite

          public short eepromWrite(FT_EEPROM eeData)

      This method encodes the settings from a `FT_EEPROM` object and writes them to the device EEPROM. remarks: `FT_EEPROM` : For FT_232A , FT_232B. `FT_EEPROM_2232H` : For FT_2232H. `FT_EEPROM_2232D` : For FT_2232. `FT_EEPROM_4232H` : For FT_4232H. `FT_EEPROM_232R` : For FT_232R. `FT_EEPROM_245R` : For FT_245R. `FT_EEPROM_232H` : For FT_232H. `FT_EEPROM_X` : For FT_X_Series.
      Parameters:
        `eeData` - A `FT_EEPROM` object containing the EEPROM settings to be written to the device. FT_EEPROM can be cast to a actual device type.
      Returns:
        Return 0 mean success

    - #### eepromErase

          public boolean eepromErase()

      Erases the device EEPROM. After erasing, all values read will be 0xFFFF. Note that the FT232R, FT245R and X-Series devices cannot have their EEPROMs erased as the EEPROM is internal to the device.
      Returns:
        Returns true on success, false otherwise.

    - #### eepromWriteUserArea

          public int eepromWriteUserArea(byte[] data)

      Writes data to the device EEPROM user area. Once written, the data can be retrieved with a call to `eepromReadUserArea(int)`.
      Parameters:
        `data` - The data to be written to the device EEPROM user area. If the amount of data being written is larger than the available space in the device EEPROM user area, the data will be truncated to the user area size.
      Returns:
        if write success will return length of data , else 0

    - #### eepromReadUserArea

          public byte[] eepromReadUserArea(int length)

      Retrieves the contents of the device EEPROM user area. The number of bytes returned will match the user area size returned from `eepromGetUserAreaSize()`
      Parameters:
        `length` - The length of word will be read
      Returns:
        An array of bytes containing the user area data from the device EEPROM. NULL for error.

    - #### eepromGetUserAreaSize

          public int eepromGetUserAreaSize()

      Retrieves the amount of additional space available in the device EEPROM. This space (the user area) can be used to store application specific data.
      Returns:
        The number of unused EEPROM bytes available to the user. Negative value for error

    - #### eepromReadWord

          public int eepromReadWord(short offset)

      This method reads a WORD from the device EEPROM at the specified address.
      Parameters:
        `address` - The EEPROM address to read from.
      Returns:
        The EEPROM data WORD read from the specified address. Negative value for error.

    - #### eepromWriteWord

          public boolean eepromWriteWord(short address,
                                short data)

      This method writes a WORD to the device EEPROM at the specified address.
      Parameters:
        `address` - The EEPROM address to write the new data to.
        `data` - The data WORD to write to the EEPROM at the address specified.
      Returns:
        Return true mean success

About FTDI | FTDI Licence Terms