src/app/host-serial/libftdi/ftdi.c
int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, int size)
{
    if (!ftdi || !(ftdi->eeprom))
        ftdi_error_return(-1, "No appropriate structure");

    if (!buf || size < ftdi->eeprom->size)
        ftdi_error_return(-1, "Not enough room to store eeprom");

    // Only copy up to FTDI_MAX_EEPROM_SIZE bytes
    if (size > FTDI_MAX_EEPROM_SIZE)
        size = FTDI_MAX_EEPROM_SIZE;

    memcpy(buf, ftdi->eeprom->buf, size);

    return 0;
}
/** Get the read-only buffer to the binary EEPROM content

    \param ftdi pointer to ftdi_context
    \param buf buffer to receive EEPROM content
    \param size Size of receiving buffer

    \retval 0: All fine
    \retval -1: struct ftdi_contxt or ftdi_eeprom missing
    \retval -2: Not enough room to store eeprom
*/
Get the read-only buffer to the binary EEPROM content
\param ftdi pointer to ftdi_context
\param buf buffer to receive EEPROM content
\param size Size of receiving buffer

\retval 0: All fine
\retval -1: struct ftdi_contxt or ftdi_eeprom missing
\retval -2: Not enough room to store eeprom
Get the read - only buffer to the binary EEPROM content \ param ftdi pointer to ftdi_context \ param buf buffer to receive EEPROM content \ param size Size of receiving buffer \ retval 0 : All fine \ retval - 1 : struct ftdi_contxt or ftdi_eeprom missing \ retval - 2 : Not enough room to store eeprom
int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char * buf, int size)
{
    if (!ftdi || !(ftdi->eeprom))
        ftdi_error_return(-1, "No appropriate structure");
    if (!buf || size < ftdi->eeprom->size)
        ftdi_error_return(-1, "Not enough room to store eeprom");
    if (size > FTDI_MAX_EEPROM_SIZE)
        size = FTDI_MAX_EEPROM_SIZE;
    memcpy(buf, ftdi->eeprom->buf, size);
    return 0;
}
int ftdi_get_eeprom_buf ( struct ftdi_context * ftdi , unsigned char * buf , int size ) { if ( ! ftdi || ! ( ftdi -> eeprom ) ) ftdi_error_return ( -1 , " " ) ; if ( ! buf || size < ftdi -> eeprom -> size ) ftdi_error_return ( -1 , " " ) ; if ( size > FTDI_MAX_EEPROM_SIZE ) size = FTDI_MAX_EEPROM_SIZE ; memcpy ( buf , ftdi -> eeprom -> buf , size ) ; return 0 ; }
Get the read-only buffer to the binary EEPROM content
\param ftdi pointer to ftdi_context
\param buf buffer to receive EEPROM content
\param size Size of receiving buffer
Get the read - only buffer to the binary EEPROM content \ param ftdi pointer to ftdi_context \ param buf buffer to receive EEPROM content \ param size Size of receiving buffer
// Only copy up to FTDI_MAX_EEPROM_SIZE bytes