User Tools

Site Tools


blog:fall2015:tmosgrov:journal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
blog:fall2015:tmosgrov:journal [2015/11/18 20:50] – [11/18/2015] tmosgrovblog:fall2015:tmosgrov:journal [2015/12/02 21:02] (current) – [12/02/2015] tmosgrov
Line 509: Line 509:
 /usr/share/misc/usb_hid_usages Shows ideal report descriptor formats for various usb devices. /usr/share/misc/usb_hid_usages Shows ideal report descriptor formats for various usb devices.
  
-More to come! :) +====12/02/2015==== 
 + 
 +Back to USB. I've been looking in all the wrong places. The library I should have been focusing on was libusb which references all of the other libraries I have occasionally stared far too long at. Those of which were probably being referenced as a lower level layer by libusb.h. 
 + 
 +Regarding libusb, 
 +When interfacing with usb devices you have two choices Synchronous, and Asynchronous. Synchronous offers a less involved method for interfacing with a USB device to make a transfer. Offering a "one function call" solution to make a transfer, but those calls may "sleep" inside libusb_bulk_transfer() until a transfer has completed. This could be a pain if a transfer process is taking longer than expected to complete. While Asynchronous offers a more controlled route with the ability to cancel a transfer, but is more complicated to use. 
 + 
 +noteAsynchronous offers simultaneous I/O operations or threading. Which libusb supports with its thread-control.  
 + 
 +**USB Transfer Types** 
 +  * Control Transfers 
 +  * Interrupt Transfers 
 +  * Isochronous Transfers 
 +  * Bulk Transfers 
 + 
 +**Control Transfers**- Command or status operations. 
 + 
 + 
 +**Interrupt Transfers**- Initiated by the device to request some action from the host. 
 + 
 + 
 +**Isochronous Transfers**- Transfers which are used to carry data the delivery of which is crucial. 
 + 
 + 
 +**Bulk Transfers**- Transfers which are used to carry data the delivery of which is not crucial. 
 + 
 + 
 +"All transfers take the form as packets, which contain certain control information and error checking fields." 
 + 
 +**The typical libusb procedure** 
 +  - Get device list 
 +  - Clear device list with libusb_free_device_list) 
 +  - Claim usb interface with libusb_claim_interface 
 +  - Do the desired I/O operations 
 +  - Release the device by using libusb_release_interface 
 +  - Close the device libusb_close 
 +  - Exit session libusb_exit
blog/fall2015/tmosgrov/journal.1447879856.txt.gz · Last modified: 2015/11/18 20:50 by tmosgrov