Questions tagged [libusb]

libusb is a library that gives user level applications uniform access to USB devices across many different operating systems.

libusb is a library that gives user level applications uniform access to USB devices across many different operating systems. It's is an open source project licensed under the GNU Lesser General Public License.

There are two versions of the libusb API: the current libusb-1.0 API, and its legacy predecessor libusb-0.1. Please use libusb-1.0 for all new development.

861 questions
6
votes
2 answers

How do I mutate the item in Iterator::find's closure?

I would like to use Iterator::find on libusb::Devices object, which has a signature like so: fn find

(&mut self, predicate: P) -> Option where Self: Sized, P: FnMut(&Self::Item) -> bool I want to find a device with a particular…

Jason Martens
  • 1,305
  • 11
  • 22
6
votes
3 answers

Android L | libusb_init returns LIBUSB_ERROR_OTHER (-99)

I trying to use libusb on not rooted Nexus 5 as advised in this approach (by transferring usb file descriptor from java to native side). My application ask permission via UsbManager.requestPermission and then run native method that call libusb_init…
CAMOBAP
  • 5,523
  • 8
  • 58
  • 93
6
votes
3 answers

Unable to claim USB interface with C + libusb on Mac OS X

I've got a compound USB + CDC device I built using a PIC32 microcontroller, and I'm trying to connect to the device and send some data to the CDC data interface endpoint from my Mac. I know the circuit works 100%, as the device registers as both a…
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
6
votes
2 answers

Accessing a USB device with libusb-1.0 as a non-root user

I am trying to interface with a USB device as a non-root user on RHEL5. The device is a GPIO interface (its documentation can be found at http://www.xdimax.com/sub20/sub20.html) which uses libusb-1.0. The procedure for opening the device, using…
Dan Gorman
  • 61
  • 1
  • 1
  • 2
6
votes
3 answers

Simulate a USB Device for Automation

I have to simulate a USB Device for automation and testing purposes (in Linux). Original driver/application for this device uses “libusb” to communicate with it. I don’t have much experience in Linux and Simulation, after some searching I have…
5
votes
2 answers

Control the power of a usb port in Python

I was wondering if it could be possible to control the power of usb ports in Python, using vendor ids and product ids. It should be controlling powers instead of just enabling and disabling the ports. It would be appreciated if you could provide…
Anthony
  • 146
  • 1
  • 9
5
votes
2 answers

libusb device descriptor: bcdUSB possible values

I'm developing a C app using libusb-1.0. I want to get some config parameters related to usb devices. My question is related to bcdUSB parameter. My code is like following: libusb_device *dev; struct libusb_device_descriptor desc; .... ret =…
Kallel Omar
  • 1,208
  • 2
  • 17
  • 51
5
votes
1 answer

gcc - undefined reference to `libusb_init'

I'm trying to compile a piece of code which uses libusb: #include #include #include int main(void) { libusb_context *context = NULL; int rc = 0; rc = libusb_init(&context); assert(rc ==…
Henk Schurink
  • 419
  • 6
  • 17
5
votes
3 answers

libusb basic example wanted

I'm writing user-space program that is intended to control some device via usb so I decided to use libusb (libusb-1.0) to send control messages to and receive responses from that device. But I constantly receive the following bunch of errors from my…
Vladimir
  • 9,913
  • 4
  • 26
  • 37
5
votes
1 answer

How do I tell CMake where to find libusb?

I'm trying to build logger1, which collects data from a Kinect for off-line SLAM by ElasticFusion. I'm building on Windows. I'm trying to build for x64 with VS10 (I have VS12 as well but some of the dependencies come pre-configured to VS10 so to…
Kevin
  • 1,179
  • 7
  • 18
5
votes
1 answer

libusb can't claim device

I'm trying to using the libusb-1.0 and QtUsb library for USB Device access. Its simple a bulk-device thats works before I did make a few updates. Currently I use Linux nadhh.fritz.box 4.11.8-200.fc25.x86_64 #1 SMP Thu Jun 29 16:13:56 UTC 2017 x86_64…
J.W.Sievers
  • 75
  • 2
  • 9
5
votes
1 answer

PyUsb does not recognize my USB device while my PC does

I'm trying to communicate between the my PC and PIC18F4550, but the program is not detecting it whereas the computer is showing it in Device Manager. import usb.core dev = usb.core.find(idVendor = 0x04D8, idProduct = 0xFEAA) The function for…
dinece
  • 113
  • 1
  • 2
  • 12
5
votes
3 answers

How do I flash an LED, using libftdi v0.18?

It's a FT2232D chip, and the LED is connected to BDBUS6. The library is less documented than I might like (better than FTDI's own library though, which doesn't even work on modern kernels), the only example code I can find that does this uses a…
John O
  • 4,863
  • 8
  • 45
  • 78
5
votes
1 answer

I'm having trouble finding example code for libftdi's mpsse (SPI) mode

This is not a homework problem, though it is a work problem. Where months ago, I would have just written up a specification and the boss would have contracted it out, money's tight. So I'm trying to do this myself. I'm a weak C coder, and I'm lucky…
John O
  • 4,863
  • 8
  • 45
  • 78
5
votes
1 answer

Testing an application using libusb without real hardware

One part of an application I am writing uses libusb to communicate with a device and I am having a hard time testing my code. Is there a framework to create fake usb devices or another way to mock libusb in order to better automate testing, to be…
fakedrake
  • 6,528
  • 8
  • 41
  • 64