libusb-1.0

libusb_claim_interface fails on Mac OS X Mountain Lion

谁说胖子不能爱 提交于 2019-12-05 08:10:29
I've searched for hours with no avail. I've seen it everywhere that libusb_detach_kernel_driver isn't supported on Mac OS X, but I haven't been able to find a patch or alternative for it. libusb_claim_interface returns this: libusb: 0.863377 error [darwin_claim_interface] USBInterfaceOpen: another process has device opened for exclusive access How can I detach the USB device from the kernel? Many devices automatically have a driver attached to the USB device they are recognised as by OSX and you will not be able to claim the device unless you force the system to detach the device manually

Get access to USB device on Linux (libusb-1.0)?

拈花ヽ惹草 提交于 2019-12-05 03:54:49
I am writing a small program to communicate with a specific USB HID product (identified by vendor and product IDs), using libusb-1.0 on Linux. Right now, I have to run the program as root because "libusb requires write access to USB device nodes". Is there a way to change the permissions on the device I need so that I don't need to run my program as root? On modern Linux systems, udevd ( man 7 udev ) creates the device nodes for USB devices when they're plugged in. Add a udev rule that matches your device (eg. you could match by USB Vendor and Product IDs), and sets the OWNER / GROUP / MODE of

How to use libusb and libusb_get_device_descriptor()?

故事扮演 提交于 2019-12-04 16:51:11
问题 I'm learning to use libusb v1.0.0 for the first time on Ubuntu 12.10. Here is some small test code I'm using to try and understand how to use this API: #include <libusb-1.0/libusb.h> ... libusb_device **list; libusb_get_device_list(ctx, &list); // Returns 11 USB devices which is correct. for (size_t idx = 0; list[idx] != NULL; idx ++) { libusb_device *dev = list[idx]; libusb_device_descriptor desc = {0}; int rc = libusb_get_device_descriptor(dev, &desc); At this point, rc == 0, meaning it

libusb cannot open USB device, permission isse. NetBeans/Ubuntu

坚强是说给别人听的谎言 提交于 2019-12-04 12:55:27
问题 I'm writing a C/C++ application in NetBeans based on libusb-1.0 on Ubuntu 12.04. I can get basic information from the USB device (for example, the interface description) but I am not able to open the device. The function libusb_open gives me the error: libusb:error [op_open] libusb couldn't open USB device /dev/bus/usb/002/003: Permission denied. libusb:error [op_open] libusb requires write access to USB device nodes. I understand that I need to change the permissions but I don't know how (I

How to use libusb and libusb_get_device_descriptor()?

梦想与她 提交于 2019-12-03 10:44:27
I'm learning to use libusb v1.0.0 for the first time on Ubuntu 12.10. Here is some small test code I'm using to try and understand how to use this API: #include <libusb-1.0/libusb.h> ... libusb_device **list; libusb_get_device_list(ctx, &list); // Returns 11 USB devices which is correct. for (size_t idx = 0; list[idx] != NULL; idx ++) { libusb_device *dev = list[idx]; libusb_device_descriptor desc = {0}; int rc = libusb_get_device_descriptor(dev, &desc); At this point, rc == 0, meaning it should have completed successfully. Source: documentation for *libusb_get_device_descriptor()* . But the

libusb cannot open USB device, permission isse. NetBeans/Ubuntu

纵然是瞬间 提交于 2019-12-03 08:19:27
I'm writing a C/C++ application in NetBeans based on libusb-1.0 on Ubuntu 12.04. I can get basic information from the USB device (for example, the interface description) but I am not able to open the device. The function libusb_open gives me the error: libusb:error [op_open] libusb couldn't open USB device /dev/bus/usb/002/003: Permission denied. libusb:error [op_open] libusb requires write access to USB device nodes. I understand that I need to change the permissions but I don't know how (I am a very basic Linux-user). Thank you! Well you can run your application in root user mode and get rid

libusb-1.0 hotplug events stop working in parent after fork(), when child calls libusb_exit()

☆樱花仙子☆ 提交于 2019-12-02 18:09:51
问题 I've been developing an application that monitors the USB device tree using libusb_hotplug_register_callback() . When a device that matches some criteria is attached, it will fork() and exec() an application to handle this device. The application has been working fine for some time now, but I've come back to try and 'tidy it up'... libusb will open a number of file descriptors (see below) which it monitors for events, etc... The problem is that after I call fork() and before I call exec() , I

libusb-1.0 hotplug events stop working in parent after fork(), when child calls libusb_exit()

和自甴很熟 提交于 2019-12-02 11:11:54
I've been developing an application that monitors the USB device tree using libusb_hotplug_register_callback() . When a device that matches some criteria is attached, it will fork() and exec() an application to handle this device. The application has been working fine for some time now, but I've come back to try and 'tidy it up'... libusb will open a number of file descriptors (see below) which it monitors for events, etc... The problem is that after I call fork() and before I call exec() , I'd like to shutdown libusb, closing the file descriptors and leaving the children in a clean state.

Package libusb was not found in the pkg-config search path

徘徊边缘 提交于 2019-12-02 06:45:09
I have installed pkg-config and libusb through brew Now if I do pkg-config --cflags --libs libusb I get below message Package libusb was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb' found So I followed this post and did export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/Cellar/libusb/1.0.20/lib/pkgconfig" But I still have the problem. What am I missing? I am using MAC OSX El Capitan Just run: pkg-config --cflags --libs /usr/local/Cellar/libusb/1.0.20/lib/pkgconfig/libusb-1.0

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 09:02:56
问题 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 HID joystick, and I'm able to connect to the device using Zoc terminal, on /dev/tty.usbmodemfa132. I can send commands with Zoc, and see my MCU responding to these commands by blinking some LEDs on the circuit. I'm running this on Mac OS X Mavericks