libusb-1.0
Public Attributes | List of all members
libusb_transfer Struct Reference

#include <libusb.h>

Collaboration diagram for libusb_transfer:
Collaboration graph
[legend]

Public Attributes

libusb_device_handledev_handle
 
uint8_t flags
 
unsigned char endpoint
 
unsigned char type
 
unsigned int timeout
 
enum libusb_transfer_status status
 
int length
 
int actual_length
 
libusb_transfer_cb_fn callback
 
voiduser_data
 
unsigned char * buffer
 
int num_iso_packets
 
struct libusb_iso_packet_descriptor iso_packet_desc [ZERO_SIZED_ARRAY]
 

Detailed Description

The generic USB transfer structure. The user populates this structure and then submits it in order to request a transfer. After the transfer has completed, the library populates the transfer with the results and passes it back to the user.

Member Data Documentation

◆ actual_length

int libusb_transfer::actual_length

Actual length of data that was transferred. Read-only, and only for use within transfer callback function. Not valid for isochronous endpoint transfers.

◆ buffer

unsigned char* libusb_transfer::buffer

Data buffer

◆ callback

libusb_transfer_cb_fn libusb_transfer::callback

Callback function. This will be invoked when the transfer completes, fails, or is cancelled.

◆ dev_handle

libusb_device_handle* libusb_transfer::dev_handle

Handle of the device that this transfer will be submitted to

◆ endpoint

unsigned char libusb_transfer::endpoint

Address of the endpoint where this transfer will be sent.

◆ flags

uint8_t libusb_transfer::flags

A bitwise OR combination of libusb_transfer_flags.

◆ iso_packet_desc

struct libusb_iso_packet_descriptor libusb_transfer::iso_packet_desc[ZERO_SIZED_ARRAY]

Isochronous packet descriptors, for isochronous transfers only.

◆ length

int libusb_transfer::length

Length of the data buffer. Must be non-negative.

◆ num_iso_packets

int libusb_transfer::num_iso_packets

Number of isochronous packets. Only used for I/O with isochronous endpoints. Must be non-negative.

◆ status

enum libusb_transfer_status libusb_transfer::status

The status of the transfer. Read-only, and only for use within transfer callback function.

If this is an isochronous transfer, this field may read COMPLETED even if there were errors in the frames. Use the status field in each packet to determine if errors occurred.

◆ timeout

unsigned int libusb_transfer::timeout

Timeout for this transfer in milliseconds. A value of 0 indicates no timeout.

◆ type

unsigned char libusb_transfer::type

Type of the transfer from libusb_transfer_type

◆ user_data

void* libusb_transfer::user_data

User context data. Useful for associating specific data to a transfer that can be accessed from within the callback function.

This field may be set manually or is taken as the user_data parameter of the following functions:

  • libusb_fill_bulk_transfer()
  • libusb_fill_bulk_stream_transfer()
  • libusb_fill_control_transfer()
  • libusb_fill_interrupt_transfer()
  • libusb_fill_iso_transfer()

The documentation for this struct was generated from the following file: