usb

USB host mode in Android device supporting OTG

我只是一个虾纸丫 提交于 2021-02-08 03:36:06
问题 I'd like to know in which mode a USB-OTG-supporting Android device is by default, - in the USB host mode or USB slave mode ? I guess, if the device is in slave mode, then there's no point of using API described on link below ? https://developer.android.com/guide/topics/connectivity/usb/host.html Is there a way to programmatically switch from host to slave mode and vice versa ? As you know, a USB OTG (On the go) device automatically switches to host or slave mode, depending on which end of an

BulkTransfer & Android USB API

我与影子孤独终老i 提交于 2021-02-08 02:10:47
问题 I have a program in which I attempt to attach my android device to a webcam via USB. I'm having trouble with a few things, namely properly transferring data. I've tried using bulkTransfer and there seems to be no recognition of it being used. I've been trying to find examples that may assist me such as here but none are helping me - their structure seems to be better than mine but whenever I switch my program crashes on load. I'm fairly confident my bytes declaration is also incorrect and I

BulkTransfer & Android USB API

无人久伴 提交于 2021-02-08 02:08:28
问题 I have a program in which I attempt to attach my android device to a webcam via USB. I'm having trouble with a few things, namely properly transferring data. I've tried using bulkTransfer and there seems to be no recognition of it being used. I've been trying to find examples that may assist me such as here but none are helping me - their structure seems to be better than mine but whenever I switch my program crashes on load. I'm fairly confident my bytes declaration is also incorrect and I

How to capture USB traffic with Wireshark in OSX Catalina (10.15)

僤鯓⒐⒋嵵緔 提交于 2021-02-07 20:59:29
问题 I am trying to get Wireshark USB captures working. Apparently the trick prior to Catalina was to just bring the interface up so that Wireshark could see it. https://forums.developer.apple.com/thread/95380 However, this does not work in Catalina because the USB hubs are not shown as interfaces any longer. Is there another known way to "bring up" these interfaces in OSX? Perhaps a new system policy setting? How would one go about finding such a thing? It might just be broken now. I imagine

How to capture USB traffic with Wireshark in OSX Catalina (10.15)

拟墨画扇 提交于 2021-02-07 20:58:43
问题 I am trying to get Wireshark USB captures working. Apparently the trick prior to Catalina was to just bring the interface up so that Wireshark could see it. https://forums.developer.apple.com/thread/95380 However, this does not work in Catalina because the USB hubs are not shown as interfaces any longer. Is there another known way to "bring up" these interfaces in OSX? Perhaps a new system policy setting? How would one go about finding such a thing? It might just be broken now. I imagine

How to get connected USB device list from windows by using python or cmd

大城市里の小女人 提交于 2021-02-07 20:39:13
问题 I need to get connected USB device list from windows by using python or cmd. for python i'm trying this. import win32com.client def get_usb_device(): try: usb_list = [] wmi = win32com.client.GetObject("winmgmts:") for usb in wmi.InstancesOf("Win32_USBHub"): print(usb.DeviceID) print(usb.description) usb_list.append(usb.description) print(usb_list) return usb_list except Exception as error: print('error', error) get_usb_device() as a result i get this: ['USB Root Hub (USB 3.0)', 'USB Composite

Get device path based on USB VID:PID in Linux

試著忘記壹切 提交于 2021-02-07 19:39:16
问题 If I plug in a device, say /dev/ttyUSB0 and I want to get the number 0 based on its VID:PID (found with lsusb ), how could I do that in C++ Linux? I have this code to find one printer device, if it's helpful at all: int printer_open (void) { char printer_location[] = "/dev/usb/lpX"; struct stat buf; // continuously try all numbers until stat returns true for the connected printer for (int i = 0; i < 10; i++) { printer_location[11] = '0' + i; if (!stat (printer_location, &buf)) break; } return

Android asks for USB permission twice

折月煮酒 提交于 2021-02-07 18:27:26
问题 I have a dev board running Android 4.0.4 and am using it as a USB accessory. When I close the application on the board then plug in an Android phone over USB the board prompts "Open AppName when this USB device is connected?". When I touch OK, the application launches and the popup is shown again, and it's also shown on the phone this time (but says accessory instead of device). I am also noticing that when I plug in the device I receive the action android.hardware.usb.action.USB_DEVICE

USB Communication between android and PC

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 14:37:42
问题 Background :I have tried finding help on stackoverflow, android developers, and various other resources on web. This is my last hope. I am new to communication and starting with implementation of USB. Following are my questions: 1) When I connect my phone to windows PC, which one is host? Suppose I want to create an application that can send data, am I making my phone host? 2) For the case (Windows PC and Android phone), the other one would be a peripheral or a device? are they same? 3) From

USB Communication between android and PC

人走茶凉 提交于 2021-02-07 14:32:19
问题 Background :I have tried finding help on stackoverflow, android developers, and various other resources on web. This is my last hope. I am new to communication and starting with implementation of USB. Following are my questions: 1) When I connect my phone to windows PC, which one is host? Suppose I want to create an application that can send data, am I making my phone host? 2) For the case (Windows PC and Android phone), the other one would be a peripheral or a device? are they same? 3) From