libusb

How to set RTS/DTR using libusb?

坚强是说给别人听的谎言 提交于 2019-12-24 09:39:53
问题 I can't see any setter RTS/DTR functions in both libusb-0.1 and libusb-1.0. Should i send smth special using usb_control_msg() ? usb device is CDC-device (not FTDI) 回答1: libusb can't do that itself - you should send 'control state' for CDC-device or FTDI-specific commands for FTDI-device. For CDC: http://cscott.net/usb_dev/data/devclass/usbcdc11.pdf `6.2.14 SetControlLineState This request generates RS-232/V.24 style control signals. ... D1 Carrier control for half duplex modems. This signal

Reference a library in IronPython using Visual Studio

让人想犯罪 __ 提交于 2019-12-24 06:33:09
问题 I'm new at Python, and I'm trying to write my first Python application on Visual Studio CE 2015 using IronPython. I finally managed to execute the most basic .NET-compatible code importing the clr module (which comes with the whole IronPython package) but, since my goal is writing an application that reads from a USB scale following this blog post, I'm stuck at trying to import the usb module. I downloaded and installed both pyUSB and libusb, so I thought I had to simply add the reference in

Reference a library in IronPython using Visual Studio

限于喜欢 提交于 2019-12-24 06:32:42
问题 I'm new at Python, and I'm trying to write my first Python application on Visual Studio CE 2015 using IronPython. I finally managed to execute the most basic .NET-compatible code importing the clr module (which comes with the whole IronPython package) but, since my goal is writing an application that reads from a USB scale following this blog post, I'm stuck at trying to import the usb module. I downloaded and installed both pyUSB and libusb, so I thought I had to simply add the reference in

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

主宰稳场 提交于 2019-12-23 09:29:05
问题 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 its API, is: sub_device d; d = sub_find_devices(0); sub_handle h = sub_open(d); When I do this, the sub_find_devices() call works, but on the sub_open() call, I get the libusb error -3, which indicates that I do not have permissions to open the device

libusb for Android using open2(, int fd)

▼魔方 西西 提交于 2019-12-23 03:34:12
问题 I compiled the modified version of libusb to be used in Android devices from https://github.com/martinmarinov/rtl_tcp_andro-/blob/master/jni/libusb-andro/README Is there any example on how to use this particular function in a C program? What headers need to be included in order for this library to work. Any examples on how to use open2(, int fd) in a C program 回答1: This is no new library. Only a modified version of libusb. So, all the libusb commands are applicable here. The only difference

Android L 5.0 & libusb 1.0.9 - no permissions?

淺唱寂寞╮ 提交于 2019-12-22 06:38:07
问题 I currently have an Android application connecting to a device via USB OTG. The communication is done using the libusb 1.0.9 and it's working pretty well for other devices with api level < 21. (The communication must be native due to performance issues) When running the app under Android L, I get the following error from libusb_init(NULL): type=1400 audit(0.0:107): avc: denied { read } for name="usb" dev="tmpfs" ino=24433 scontext=u:r:untrusted_app:s0 tcontext=u: object_r:usb_device:s0 tclass

libusb_claim_interface fails on Mac OS X Mountain Lion

淺唱寂寞╮ 提交于 2019-12-22 05:10:32
问题 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? 回答1: Many devices automatically have a driver attached to the USB device they are recognised as by OSX

pyusb: cannot set configuration

a 夏天 提交于 2019-12-21 11:25:12
问题 I am trying to make a script (on linux) that can turn a light in my mouse on or off. This is the code I have so far: import usb.core import usb.util import sys interface = 0 dev = usb.core.find(idVendor=0x1532, idProduct=0x0017) def main(): if dev is None: print "device not found" else: print "device found" if dev.is_kernel_driver_active(interface) is True: print "but we need to detach kernel driver" dev.detach_kernel_driver(interface) print "claiming device" usb.util.claim_interface(dev,

Compiling against libusb-dev on Ubuntu

扶醉桌前 提交于 2019-12-21 04:22:18
问题 I am trying to compile the example libusb.c provided by libusb package (if you dl the source code.) It doesn't work to say the least. #include <stdio.h> #include <sys/types.h> #include <libusb/libusb.h> That causes it to fail, there is no libusb/libusb.h it's usb.h , so I change that. And it fails in new and innovative ways. I've copied the file over, exactly, and named it example.c I am using these commands and variations: gcc -o example example.c -lusb -L /usr/lib/libusb.a gcc -o example

How can I comunicate with this device using pyusb?

泪湿孤枕 提交于 2019-12-20 02:59:15
问题 I have a Netware uniFlow device. When I plug it in it shows up in dmesg: [ 2962.369905] usb 2-1.4: new full-speed USB device number 11 using ehci-pci [ 2962.463867] usb 2-1.4: New USB device found, idVendor=171b, idProduct=2001 [ 2962.463871] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2962.463874] usb 2-1.4: Product: USB Keyboard [ 2962.463876] usb 2-1.4: Manufacturer: RFIDeas [ 2962.465361] input: RFIDeas USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2