Projekt

Obecné

Profil

Stáhnout (368 Bajtů) Statistiky
| Větev: | Tag: | Revize:
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
(4-4/4)