libusb

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

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 回答1: Just run: pkg-config --cflags -

Details on USB- no luck so far

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been looking for a detailed description for how USB protocol and cabling works for a long time with no luck. I am looking for a detailed yet not overcomplicated explanation of how things work on the software and hardware side of USB. Links and explanations would be appreciated. I've really run out of ideas, so it would be great if you can help me out. This is what I do know: USB hardware carries 4 lines- 5V power, ground, and 2 full duplex lines. When connecting, the device can ask for a specified amount of current. The transfer speeds

How to Link a third Party Library (LibUSB) in CMake

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am attempting to use LibUSB in a project. However whenever I attempt to use basic libUSB functions I get the following error: ...src/main/main.cpp.o: In function `main': ...src/main/main.cpp:10: undefined reference to `libusb_init' ...src/main/main.cpp:11: undefined reference to `libusb_set_debug' collect2: error: ld returned 1 exit status The package LibUSB-devel is installed (I'm on fedora 22) and my IDE KDevelop finds and recognises the headers, to the point it offers LibUSB code completions once you have added the import statement. I

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

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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, but had the same problem with a similar example

libusb_open returns 'LIBUSB_ERROR_NOT_SUPPORTED' on Windows 7

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been developing USB drivers using LibUSB on Linux, but now I want to have one of my drivers compiled for Windows (this is the first time I am doing it). My environment MinGW compiler (also using Dev-cpp IDE), and I am using a pre-compiled libusb library downloaded from this link . My device: It's a HID touch device. So no drivers are required for Windows. I have an additional endpoint to get certain debug data. My code: I have compiled code to list all the devices and USB devices connected to my machine, and the code works. Now I add

Pyusb on windows - no backend available

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to have my python application interface with an NFC device via USB. The best option seems to be pyusb, but I can't get it to connect to the libusb backend. I keep getting ValueError: No backend available I've looked at the stack trace, and found that usb/backend/libusb10.py (which is part of pyusb) is trying to load libusb-1.0.dll to use as the backend, but it can't find it. It's not that its not in my path, its not on my computer at all! I have installed libusb-win32 ( http://libusb.org/wiki/libusb-win32 ), but the resulting

Trouble linking libusb using Cmake

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been trying to 'hack' 2 programs together and one of them (openTLD) uses cmake. I've been reading up and working on this issue for a bit now and can't seem to sort it. When I 'make' where there is no instantiation of the cpp object it compiles fine, when I have an object (that relies on libusb) that I hacked in I'm getting linking (I think) errors. My CMakeLists (added bits delimeted by ** or CAPS) #Set minimum version requered cmake_minimum_required(VERSION 2.4.6) #just to avoid the warning if(COMMAND cmake_policy) cmake_policy(SET

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

倖福魔咒の 提交于 2019-12-03 00:35:44
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.getBroadcast(ctxt, 0, new Intent(ACTION_USB_PERMISSION), 0); IntentFilter filter = new IntentFilter

libusb_bulk_transfer 异步同步

不想你离开。 提交于 2019-12-02 21:33:04
同步方式 libusb_bulk_transfer(devh, ep_bulk, buf, CAM_BUF_SZ, &len, timeout); 进入libusb研究,发现libusb是采用异步方式来实现的。在do_sync_bulk_transfer中: static int do_sync_bulk_transfer ( struct libusb_device_handle * dev_handle , unsigned char endpoint , unsigned char * buffer , int length , int * transferred , unsigned int timeout , unsigned char type ) { libusb_fill_bulk_transfer ( transfer , dev_handle , endpoint , buffer , length , bulk_transfer_cb , & completed , timeout ); transfer -> type = type ; r = libusb_submit_transfer ( transfer ); if ( r < 0 ) { libusb_free_transfer ( transfer ); return r ; } while (!

libusb_bulk_transfer 说明

徘徊边缘 提交于 2019-12-02 08:09:37
libusb_bulk_transfer函数说明 API_EXPORTED int libusb_bulk_transfer (struct libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *transferred, unsigned int timeout) { // 调用do_sync_bulk_transfer return do_sync_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout, LIBUSB_TRANSFER_TYPE_BULK); } 代码: static int do_sync_bulk_transfer (struct libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, int *transferred, unsigned int timeout, unsigned char type) { struct libusb_transfer * transfer = libusb_alloc