libusb

UsbDeviceConnection requestWait() native crash

北慕城南 提交于 2019-12-03 22:30:50
I'm using the 2 interrupted endpoints (IN and OUT) of the device that I want to communicate from 2 threads: a WriteThread that queues packets through a UsbRequest initialized of the OUT endpoint (this is the communication from my app to the device) and a ReadThread that queues reads from the device through a UsbRequest initialized of the IN endpoint (this is the communication from the device to my app) I'm doing this because UsbDeviceConnection.requestWait() blocks ReadThread thread and I need to be able to write and read at the same time. The problem is that when I try to write and read at

libusb bulk transfer

时间秒杀一切 提交于 2019-12-03 13:39:05
问题 I am trying to implement user space usb driver using libusb1.0.9. I have lpc2148 blueboard(ARM7) with me..This board is loaded with opensource USB stack/firmware by Mr. Bertrik Sikken. Now my user space driver is trying read write with board. I am getting garbage data. I want to know about the flow of bulk tranfer. For any transfer/transaction is there kernel device driver involved?? and do we need usb gadget device driver also?? I am not able to understand that where the data gets copied.

Determine USB device file Path

老子叫甜甜 提交于 2019-12-03 12:13:35
How can i get USB device file path correctly in Linux. I used command: find / -iname "usb" and got the result as below: /dev/bus/usb /sys/bus/usb /sys/bus/usb/drivers/usb /sys/kernel/debug/usb Under /dev/bus/usb i see: 001 002 003 004 005 006 But I think they aren't files as i need. Under /sys/bus/usb/devices/: sh-3.2# ls /sys/bus/usb/devices/ 1-0:1.0 1-1:1.0 3-0:1.0 5-0:1.0 usb1 usb3 usb5 1-1 2-0:1.0 4-0:1.0 6-0:1.0 usb2 usb4 usb6 And Under /sys/bus/scsi/devices/ when i pluged an USB i see: 2:0:0:0 host0 host2 target2:0:0 And when i removed USB i see: sh-3.2# ls host0 So which device file is

USB permission obtained via android.hardware.usb does not apply to NDK

南楼画角 提交于 2019-12-03 10:58:31
问题 I was able to obtain a permission to communicate with a device via Android's USB Host API. private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION"; protected void execute(Context ctxt) { UsbManager manager = (UsbManager) viewer.getSystemService(Context.USB_SERVICE); HashMap<String, UsbDevice> deviceList = manager.getDeviceList(); UsbDevice d = null; for (String s : deviceList.keySet()) { d = deviceList.get(s); } PendingIntent mPermissionIntent = PendingIntent

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

Linking libusb in Mac OS X

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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/pkgconfig/libusb-1.0.pc /usr/local/Cellar/libusb/1.0.9

How to make libusb library visible to another program?

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to compile hidapi library. In order to compile that, I need libusb-1.0 . I've downloaded that, configured, made and installed to /usr/local/lib . But when I try to compile hidapi , it doesn't see libusb-1.0 : cc -Wall -g -c -I../hidapi pkg-config libusb-1.0 --cflags hid-libusb.c -o hid-libusb.o -L/usr/local/lib Package libusb-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb-1.0' found /bin/sh: cc: not

Android L | libusb_init returns LIBUSB_ERROR_OTHER (-99)

你离开我真会死。 提交于 2019-12-03 07:55:44
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 to create libusb_context . But libusb_init returns LIBUSB_ERROR_OTHER code (-99). After digging in the code I see why this happening. libusb reports 'could not find usbfs' because opendir("/dev/bus/usb") returns 0 . Also from adb shell I can't perform ls /dev , strange because I have rights (on Huawei U8950-1 with the same rights I can do this):

libusb bulk transfer

不想你离开。 提交于 2019-12-03 03:44:22
I am trying to implement user space usb driver using libusb1.0.9. I have lpc2148 blueboard(ARM7) with me..This board is loaded with opensource USB stack/firmware by Mr. Bertrik Sikken. Now my user space driver is trying read write with board. I am getting garbage data. I want to know about the flow of bulk tranfer. For any transfer/transaction is there kernel device driver involved?? and do we need usb gadget device driver also?? I am not able to understand that where the data gets copied. Important thing is that when I read/write interrupt gets generated and I can see correct data on LCD. Do

Android ADK with PC as USB Host with libusb, bulk transfer error

偶尔善良 提交于 2019-12-03 03:25:32
问题 I'm trying to make my PC the USB Host for Android 2.3.4 devices in order to be able to develop APIs without needing actual "accessories". To do this, I need to establish the PC as the USB Host and the "device" (in my case a Nexus One running 2.3.4). I started with libusb code from http://android.serverbox.ch/ as a base for the PC side and the DemoKit code and Android documentation on the Android side. The two seems to negotiate the connection fine, and the interface gets "claimed" but dies on