ftdi_stream.c man page



#include <stdlib.h>
#include <stdio.h>
#include <libusb.h>
#include 'ftdi.h'


struct FTDIStreamState


int ftdi_readstream (struct ftdi_context *ftdi, FTDIStreamCallback *callback, void *userdata, int packetsPerTransfer, int numTransfers)

Function Documentation

int ftdi_readstream (struct ftdi_context * ftdi, FTDIStreamCallback * callback, void * userdata, int packetsPerTransfer, int numTransfers)

Streaming reading of data from the device

Use asynchronous transfers in libusb-1.0 for high-performance streaming of data from a device interface back to the PC. This function continuously transfers data until either an error occurs or the callback returns a nonzero value. This function returns a libusb error code or the callback's return value.

For every contiguous block of received data, the callback will be invoked.


ftdi pointer to ftdi_context
callback to user supplied function for one block of data
packetsPerTransfer number of packets per transfer
numTransfers Number of transfers per callback

Definition at line 147 of file ftdi_stream.c.

References BITMODE_RESET, ftdi_set_bitmode(), ftdi_usb_purge_buffers(), ftdi_context::max_packet_size, ftdi_context::out_ep, ftdi_context::type, TYPE_2232H, TYPE_232H, and ftdi_context::usb_dev.


Generated automatically by Doxygen for libftdi1 from the source code.


Mon Jul 31 2017 Version 1.3 libftdi1