src/app/host-serial/libftdi/ftdi.c
int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
{
    if (ftdi == NULL || ftdi->usb_dev == NULL)
        ftdi_error_return(-2, "USB device unavailable");

    if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, (unsigned char *)eeprom_val, 2, ftdi->usb_read_timeout) != 2)
        ftdi_error_return(-1, "reading eeprom failed");

    return 0;
}
/**
    Read eeprom location

    \param ftdi pointer to ftdi_context
    \param eeprom_addr Address of eeprom location to be read
    \param eeprom_val Pointer to store read eeprom location

    \retval  0: all fine
    \retval -1: read failed
    \retval -2: USB device unavailable
*/
Read eeprom location
\param ftdi pointer to ftdi_context
\param eeprom_addr Address of eeprom location to be read
\param eeprom_val Pointer to store read eeprom location

\retval  0: all fine
\retval -1: read failed
\retval -2: USB device unavailable
Read eeprom location \ param ftdi pointer to ftdi_context \ param eeprom_addr Address of eeprom location to be read \ param eeprom_val Pointer to store read eeprom location \ retval 0 : all fine \ retval - 1 : read failed \ retval - 2 : USB device unavailable
int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
{
    if (ftdi == NULL || ftdi->usb_dev == NULL)
        ftdi_error_return(-2, "USB device unavailable");
    if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, (unsigned char *)eeprom_val, 2, ftdi->usb_read_timeout) != 2)
        ftdi_error_return(-1, "reading eeprom failed");
    return 0;
}
int ftdi_read_eeprom_location ( struct ftdi_context * ftdi , int eeprom_addr , unsigned short * eeprom_val ) { if ( ftdi == NULL || ftdi -> usb_dev == NULL ) ftdi_error_return ( -2 , " " ) ; if ( libusb_control_transfer ( ftdi -> usb_dev , FTDI_DEVICE_IN_REQTYPE , SIO_READ_EEPROM_REQUEST , 0 , eeprom_addr , ( unsigned char * ) eeprom_val , 2 , ftdi -> usb_read_timeout ) != 2 ) ftdi_error_return ( -1 , " " ) ; return 0 ; }
Read eeprom location
\param ftdi pointer to ftdi_context
\param eeprom_addr Address of eeprom location to be read
\param eeprom_val Pointer to store read eeprom location
Read eeprom location \ param ftdi pointer to ftdi_context \ param eeprom_addr Address of eeprom location to be read \ param eeprom_val Pointer to store read eeprom location