libusb prototypes in Linux (usb.h)

Note: These routines extensively use data descriptor structures that contain a series of bytes with a header identifying the length and type of the data. See descriptors.c for the code dealing with these.

usb_dev_handle *usb_open(struct usb_device *dev);

int usb_close(usb_dev_handle *dev);

int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, size_t buflen);

int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, size_t buflen);

int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, unsigned char type, unsigned char index, void *buf, int size);

int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, unsigned char index, void *buf, int size);

int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout);

int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout);

int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout);

int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout);

int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout);

int usb_set_configuration(usb_dev_handle *dev, int configuration);

int usb_claim_interface(usb_dev_handle *dev, int interface);

int usb_release_interface(usb_dev_handle *dev, int interface);

int usb_set_altinterface(usb_dev_handle *dev, int alternate);

int usb_resetep(usb_dev_handle *dev, unsigned int ep);

int usb_clear_halt(usb_dev_handle *dev, unsigned int ep);

int usb_reset(usb_dev_handle *dev);

int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, unsigned int namelen);

int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface);

char *usb_strerror(void);

void usb_init(void);

void usb_set_debug(int level);

int usb_find_busses(void);

int usb_find_devices(void);

struct usb_device *usb_device(usb_dev_handle *dev);

struct usb_bus *usb_get_busses(void);


Last updated: December 28, 2006

Valid CSS! Valid XHTML 1.0 Strict

Contact Craig Van Degrift if you have problems or questions with this web site.