libusb

Libusb and how to use its packages in Ubuntu

…衆ロ難τιáo~ 提交于 2019-12-10 15:04:34
问题 I have installed libusb by using the following command. I am not sure if it was right or not and the command was sudo apt-get install libusb-dev Once I have installed (and I am not sure if it has installed or not because I am a novice user of Ubuntu), I want to know how would I use the library, because I write some sample code which uses <libusb.h>, but when I compile that C++ file using g++ test_libusb.cpp that throws the following error, test_libusb.cpp:2:20: fatal error: libusb.h: No such

libusb - How to select an alternate setting of a usb-soundcard for stereo recording?

那年仲夏 提交于 2019-12-09 23:52:38
问题 I have a USB sound card that has the following setup and allows for stereo recording with 48000hz 2 channels 16 bit, so I'm trying to set it up that way: UsbConfiguration[mId=1,mName=null, mAttributes=160, mMaxPower=50, mInterfaces=[ UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=1,mSubclass=1,mProtocol=0, mEndpoints=[] UsbInterface[mId=1,mAlternateSetting=0,mName=null,mClass=1,mSubclass=2,mProtocol=0, mEndpoints=[] UsbInterface[mId=1,mAlternateSetting=1,mName=null,mClass=1

Linking libusb in Mac OS X

你说的曾经没有我的故事 提交于 2019-12-09 22:49:51
问题 I have this very simple piece of code that I'm trying to compile. I'm fairly new to GCC from the command line, so please forgive me. I've tried a quite few different things with GCC, but I'm still unable to get it to compile. I do have libusb installed. How can I get this piece of code to compile? Libusb: anything:usb mymac$ brew list libusb /usr/local/Cellar/libusb/1.0.9/include/libusb-1.0/libusb.h /usr/local/Cellar/libusb/1.0.9/lib/libusb-1.0.0.dylib /usr/local/Cellar/libusb/1.0.9/lib

Installing libusb-1.0 on Windows 7

妖精的绣舞 提交于 2019-12-08 10:37:40
问题 It seems that the easiest way to install libusb-1.0.9 onto Windows 7 for use in Visual C++ is to use Cygwin or similar software to build and install it to my computer. Is there an easier way to do it that I have not found, or am I going about this all wrong? I would like to use libusb to communicate with an Arduino Due, and development will be done in Visual Studio (and maybe Dev-C++). 回答1: You can use libusb-win32 for this. To install libusb on Windows 7 download the bin package for libusb

how to send and receive data to serial port or USB port in asp.net?

与世无争的帅哥 提交于 2019-12-08 08:39:24
问题 I am developing a web application for a parking I wanna control gateways entrance with a device connected to USB port but we know that browser is in "Sand Box" so no access to computer's port I search the web and found out there is some possibility to do so via ActiveX and/or Java Applets but I'm novice to these things and want a complete tutorial or a wiki book that describe it or even class libraries relative to I want to send data to a USB or COM Port via asp.net application (Client Side)

How to solve LIBUSB_ERROR_BUSY on Raspberry Pi (Debian) running Node.js

China☆狼群 提交于 2019-12-08 02:04:37
问题 I am running node.js on a raspberry pi 3 (debian). I have a little prototype project which gathers data from an ANT+ transmitter on my turbo trainer, which is being sent via a Suunto Movestick USB dongle. I am using the Ant-Plus node module to manage the ANT+ protocol and a script which outputs the data to the console and sends via REST API to cloud storage. Anyhow, cutting to the chase, it was all working fine, multiple process start and stops with no problems, until I inadvertently killed

How to interact with USB device using PyUSB

假装没事ソ 提交于 2019-12-08 01:26:00
问题 I have so far gotten to the stage of finding the device, now I am ready to talk to the USB using the devices protocol laid out in the specification on page 22. libusb is installed on my machine and so is PyUSB. import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x067b, idProduct=0x2303) # was it found? if dev is None: raise ValueError('Device not found') # b are bytes, w are words reqType = '' bReq = '' wVal = '' wIndex = '' dev.ctrl_transfer(reqType, bReq, wVal,

Error message 'Interface not claimed' from libusb

余生长醉 提交于 2019-12-06 22:32:34
问题 I'm trying to use libusb, but I am get the following error message: usbfs: process 24665 (myprogram) did not claim interface 0 before use I don't really understand why, because as far as I can tell, I'm doing it according to the description found in the library. Here's my code: #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <libusb.h> int main(void) { int result; struct libusb_device_descriptor desc; libusb_device **list; libusb_device *my_device = NULL; result =

libusb for Android using open2(, int fd)

非 Y 不嫁゛ 提交于 2019-12-06 21:51:30
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 This is no new library. Only a modified version of libusb. So, all the libusb commands are applicable here. The only difference would be libusb_open2 which you would have to use in stead of libusb_open. From the libusb/libusb.h file, the

linux / libusb get usb device path

懵懂的女人 提交于 2019-12-06 21:10:55
问题 I use libusb to enumerate over a few usb-devices. Now i like to get the "device-path". I think it's not called usb device-path, because i was not successful with google. If i connect a usb-device with linux, i get a message in dmesg , here are a few examples for such a "device-path" with an usb temperature sensor (something like this): Directly to a usb port: [68448.099682] generic-usb 0003:0C45:7401.0056: input,hidraw1: USB HID v1.10 Keyboard [RDing TEMPer1V1.2] on usb-0000:00:12.0-1/input0