Sending data via USB using PyUSB

时光怂恿深爱的人放手 提交于 2019-12-06 11:19:11

As stated in the tutorial:

[...] a device does not work without setting a configuration, even if it has just one! [...]

Apparently most of the times there is only one configuration. Assuming all those configurations are from different devices, you can do something like:

for dev in devList:
    for cfg in dev:

        cfg.set()

        for intf in cfg:

If you can't set a configuration due to "resource busy", you'll need to unload its interface kernel driver:

dev.detatch_kernel_driver(interface)

I had this problem. Got corrected by using

dev.set_configuration()

pyUSB Tutuorial

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!