DISCUSSION: Developing Linux Device Drivers using Libusb API
LinuxAnswers DiscussionThis forum is to discuss articles posted to LinuxAnswers.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
stdbool.h (otherwise it doesn't know bool and true) and string.h (to remedy warnings about strlen)
Also, in C99 i can't use for (int i=0 bla bla)
first define int i; for (i=0 blabla) does the job.
Also rename read to read_from_device and write to write_to_device
Important attributes of USB devices useful in device driver coding
Configuration and Endpoints are one of the two important descriptors of any USB device. These desciptors are defined using the “struct usb_config_descriptor” and “struct_usb_endpoint_descriptor” respectively .
dev->descriptor.idVendor : Reveals the Vendor-Id of the USB device connected to the system.
dev->descriptor.idProduct : Reveals the Product-Id of the USB device connected to the system.
dev->descriptor.iManufacturer : Reveals the name of the Manufacturer USB device connected to the system.
EndpointAddress:Combination of endpoint address and enpoint direction on a USB device.
InterfaceNumber : One of the several interfaces that is allocated to the connected USB device.
AlternateSetting:This is part of the a single interface allocated to the USB device.
Prerequites for Libusb programming
Linux system with Kernel 2.4 above series.
Proficiency in C language.
Good understanding of USB device internals.
Idea about USBFS.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.