usb

LibUsb claim interface access denied Java

时光毁灭记忆、已成空白 提交于 2019-12-05 11:41:03
问题 I want to be able to read data from an USB pedometer. I'm trying this in Java and I'm using the LibUsb and Usb4Java libraries. I can't seem to claim the usb pipe or anything like that. The code I'm using: final Context context = new Context(); int result = LibUsb.init(context); if (result < 0) { throw new LibUsbException("Unable to initialize libusb", result); } DeviceHandle handle = LibUsb.openDeviceWithVidPid(context, vid, pid); if (handle != null) { Device d = LibUsb.getDevice(handle); int

c# usb detection

青春壹個敷衍的年華 提交于 2019-12-05 11:29:34
We have several processes in the current Application. One process handles about detection and removel of USB loader. The code to handle detection and removal as below. protected override void WndProc(ref Message m) { switch (m.Msg) { case Win32.WM_DEVICECHANGE: OnDeviceChange(ref m); break; } base.WndProc(ref m); } private void OnDeviceChange(ref Message msg) { int wParam = (int)msg.WParam; Win32.DEV_BROADCAST_VOLUME dbVol = new Win32.DEV_BROADCAST_VOLUME(); Win32.DEV_BROADCAST_HDR msgDevHeader = new Win32.DEV_BROADCAST_HDR(); const int DBT_DEVTYP_VOLUME = 0x00000002; string loaderUpdates;

cross platform usb module for python?

亡梦爱人 提交于 2019-12-05 11:04:06
I was interested in doing some cross platform work with a usb device in python, any tips or recommendations on modules that can do this type of thing? I've looked around SF and googlecode without a lot of luck. thanks! ct PyUSB is what you are looking for. it is a wrapper around libusb which works on linux and was ported on Windows. 来源: https://stackoverflow.com/questions/1928936/cross-platform-usb-module-for-python

How can I read files from usb device on android?

丶灬走出姿态 提交于 2019-12-05 10:49:48
I'm trying to create something like file explorer through connected usb devices(via OTG or usb ports on android TV). All I need for this is a path something like "/storage/sda4" and device identifier, and then I can work with device through simle android class File. Is sounds simple but I can't find any info about this, but all file explorers can do it (for example ESExplorer). Ok, I find a simple way to get all connected usb devices with identifier UsbManager usbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE); usbManager.getDeviceList(); but how can I get an info about

Android USB Vendor IDs for unknown brand [closed]

只愿长相守 提交于 2019-12-05 10:32:18
Refer to http://developer.android.com/guide/developing/device.html#VendorIds , I want to buy a unknown brand Android device, such as http://app-4-android.blogspot.com/2011/09/ainol-novo-8-android-22-8-in-tablet.html , How can I get the USB Vendor ID? Can it be used to develop Android App? Please advise. Phill try lsusb command on linux terminal, this show you the vendor id you can use google vid 18d1. It worked for me. 来源: https://stackoverflow.com/questions/7548023/android-usb-vendor-ids-for-unknown-brand

UsbDeviceConnection requestWait() native crash

倖福魔咒の 提交于 2019-12-05 10:06:38
问题 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

Android studio on Mac cannot detect connected USB phone

人盡茶涼 提交于 2019-12-05 09:46:56
Constant issue with being able to connect an Android device via USB to Android Studio running on a Mac. Tried numerous things like: Switching USB debugging mode on Android to MTP or PTP Restarting the Android devices and Android Studio and/or Mac trying adb kill-server and then adb devices , which usually resulted in: List of devices attached daemon not running. starting it now on port 5037 adb E 655 23135 usb_osx.cpp:327] Could not open interface: e00002c5 adb E 655 23135 usb_osx.cpp:289] Could not find device interface daemon started successfully But not actually finding the connected device

Which DLL is [DllImport] loading?

不羁岁月 提交于 2019-12-05 09:02:32
I'm using the [DllImport] attribute to import a native DLL into my application but the DLL it's loading isn't in the local bin folder. It's being loaded from elsewhere on the system, but I can't work out where. It works on my dev machine but not on a clean one. I've enabled Fusion logging and that only shows me managed assemblies. I've dumped the process using Sysinternals Process Explorer and that's telling me it's in C:\Windows\System32 but I can't see the file there in Windows Explorer. It might be worth noting that I'm running 64 bit Windows 7 but the DLL only supports x86 so I've had to

USB bulkTransfer between Android tablet and camera

▼魔方 西西 提交于 2019-12-05 08:24:34
问题 I would like to exchange data/commands between a camera and an Android tablet device using the bulkTransfer function. I wrote this Activity, but the method bulkTransfer returns -1 (error status). Why does it return the error? public class MainActivity extends Activity { private TextView text; private int TIMEOUT = 1000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); text = (TextView) findViewById(R.id

Windows PC as a USB slave to emulate a thumbdrive

霸气de小男生 提交于 2019-12-05 07:55:41
I need to create a application that will allow a Windows PC (XP/Vista) to emulate a thumbdrive. That is, when the PC is plugged into either another Windows system, or in this case, a piece of hardware that allows for USB thumbdrives to be plugged in, a folder on the computer looks like a giant thumbdrive. Any thoughts on where a guy would start to investigate this? Update (more specific description): I need to connect my PC to one of the newer multifuction devices that support scanning to a USB thumbdrive that is inserted into the front of the device. These units do not support WIA or TWAIN