-
Notifications
You must be signed in to change notification settings - Fork 6
USB API
Ankur Yadav edited this page Aug 16, 2015
·
6 revisions
#USB API
This page contains native API functions for accessing USB of beaglebone black. Code of this API can be found in usb.c. Sample JNI wrapper functions can be found here. Note : _This API using libusb library. It is only to demonstrate how libusb can be used, it does not contain all functionalities of libusb. _
###CAN API functions description
- ssize_t usbInit() : It creates USB session and gets number of USB devices attached and then returns number of USB devices attached.
- int usbGetDevices(int ids[][8], unsigned char strings[][3][256]) : This function takes one 2D array to store IDs (bus, device, manufacturer and vendor) for each USB device and one 3D array to store path, manufacturer descriptor and vendor descriptor. It returns 0 if successful and -1 if it fails. It is only to demonstrate and develop lsusb kind of app. Similar functions can be made using libusb for other functionalities of USB.
- void usbClose() : This function is used to close USB devices.