import
usb
(相关资料图)
.
core
# find USB devices
dev
=
usb
.
core
.
find
;">=
True
)
# loop through devices, printing vendor and product ids in decimal and hex
for
cfg
in
dev
:
# Check if the device is a TYPEC device
if
cfg
.
bDeviceClass
==
and
cfg
.
bDeviceSubClass
==
and
cfg
.
bDeviceProtocol
==
:
;">"Device ID: "
,
hex
;">.
idVendor
)
,
":"
,
hex
;">.
idProduct
)
)