src/app/host-serial/libftdi/ftdi.c
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
{
    unsigned short usb_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_GET_LATENCY_TIMER_REQUEST, 0, ftdi->index, (unsigned char *)&usb_val, 1, ftdi->usb_read_timeout) != 1)
        ftdi_error_return(-1, "reading latency timer failed");

    *latency = (unsigned char)usb_val;
    return 0;
}
/**
    Get latency timer

    \param ftdi pointer to ftdi_context
    \param latency Pointer to store latency value in

    \retval  0: all fine
    \retval -1: unable to get latency timer
    \retval -2: USB device unavailable
*/
Get latency timer
\param ftdi pointer to ftdi_context
\param latency Pointer to store latency value in

\retval  0: all fine
\retval -1: unable to get latency timer
\retval -2: USB device unavailable
Get latency timer \ param ftdi pointer to ftdi_context \ param latency Pointer to store latency value in \ retval 0 : all fine \ retval - 1 : unable to get latency timer \ retval - 2 : USB device unavailable
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
{
    unsigned short usb_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_GET_LATENCY_TIMER_REQUEST, 0, ftdi->index, (unsigned char *)&usb_val, 1, ftdi->usb_read_timeout) != 1)
        ftdi_error_return(-1, "reading latency timer failed");
    *latency = (unsigned char)usb_val;
    return 0;
}
int ftdi_get_latency_timer ( struct ftdi_context * ftdi , unsigned char * latency ) { unsigned short usb_val ; if ( ftdi == NULL || ftdi -> usb_dev == NULL ) ftdi_error_return ( -2 , " " ) ; if ( libusb_control_transfer ( ftdi -> usb_dev , FTDI_DEVICE_IN_REQTYPE , SIO_GET_LATENCY_TIMER_REQUEST , 0 , ftdi -> index , ( unsigned char * ) & usb_val , 1 , ftdi -> usb_read_timeout ) != 1 ) ftdi_error_return ( -1 , " " ) ; * latency = ( unsigned char ) usb_val ; return 0 ; }
Get latency timer
\param ftdi pointer to ftdi_context
\param latency Pointer to store latency value in
Get latency timer \ param ftdi pointer to ftdi_context \ param latency Pointer to store latency value in