usb

How to disable battery charging during ADB connection?

我们两清 提交于 2020-12-28 02:51:50
问题 Problem description: Each time wen I connect USB cable between PC and my mobile phone the battery automatically is charged. I want to use ADB protocol but I don't want to charge my battery during ADB connection. Is it possible to to turn off this charging? And ofcourse how can I do this? Environment: Mobile phone with Android os 4 and higher I need only mention that my referential device working on android 5 so there is no /sys/class/power_supply/battery/force_usb_charging file 回答1: BEWARE:

Get Serial Number of USB device with Python 3

∥☆過路亽.° 提交于 2020-12-10 16:12:27
问题 I have been using pyusb to access the detail of a printer plugged in via USB. I currently have the following code working, but it appears that different devices require a different index. Here is my current code: import usb dev = usb.core.find(idProduct=0x001f) print(usb.util.get_string(dev,256,3)) dev2 = usb.core.find(idProduct=0x0009) print(usb.util.get_string(dev2,256,3)) The code for dev works perfectly, outputting a serial number, but dev2 outputs 'Zebra,' the manufacturer name. If I

Get Serial Number of USB device with Python 3

不羁的心 提交于 2020-12-10 16:05:51
问题 I have been using pyusb to access the detail of a printer plugged in via USB. I currently have the following code working, but it appears that different devices require a different index. Here is my current code: import usb dev = usb.core.find(idProduct=0x001f) print(usb.util.get_string(dev,256,3)) dev2 = usb.core.find(idProduct=0x0009) print(usb.util.get_string(dev2,256,3)) The code for dev works perfectly, outputting a serial number, but dev2 outputs 'Zebra,' the manufacturer name. If I