aswi2022bug-thugs-gitlab/client/usb_detector/usb_reader.py @ f7fb8759
1 |
import usb.core |
---|---|
2 |
import usb.util |
3 |
|
4 |
|
5 |
def read_connected_devices(): |
6 |
detected_devices = [] |
7 |
|
8 |
busses = usb.busses() |
9 |
|
10 |
for bus in busses: |
11 |
devices = bus.devices |
12 |
for dev in devices: |
13 |
detected_devices.append({ |
14 |
"vendor_id": dev.idVendor, |
15 |
"product_id": dev.idProduct |
16 |
})
|
17 |
|
18 |
return detected_devices |
- « Předchozí
- 1
- 2
- 3
- 4
- Další »