admin管理员组文章数量:1399881
the nfcpy doc describe five way to select a usb nfc reader :
>>> import nfc
>>> clf = nfc.ContactlessFrontend()
>>> assert clf.open('usb:003:009') is True # open device 9 on bus 3
>>> assert clf.open('usb:054c:02e1') is True # open first PaSoRi 330
>>> assert clf.open('usb:003') is True # open first Reader on bus 3
>>> assert clf.open('usb:054c') is True # open first Sony Reader
>>> assert clf.open('usb') is True # open first USB Reader
>>> clf.close() # previous open calls implicitly closed the device
In my case I have four identical nfc readers plugged on four different usb ports. I can't use the idVendor:IdProduct as it is the same for all four devices. and I can't reliably use the bus:device as the device number will change each time I remove/connect the device. And I'm not sure if the device number will stay consistent after a reboot.
Is there a way I can identify a specific device when I have multiple identical devices ?
本文标签:
版权声明:本文标题:python 3.x - Select a specific USB device with nfcpy when I have multiple identical devices plugged - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744137732a2592475.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论