在使用navigator.usb.requestDevice访问连接的设备后,我尝试打开与连接的设备的连接,如下所示:
device.open()
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(1))它似乎成功地选择了配置,但是claimInterface步骤将产生以下错误:
DOMException: Unable to claim interface.我在Ubuntu16.10上运行Chrome55.0.2883.75测试版,--disable-webusb-security标志为根(没有那些我没有得到任何设备)。
如何才能使连接正常运行?
编辑:
似乎cdc_acm驱动程序已经声明了接口,因为我尝试连接的设备是串行设备,卸载驱动程序将允许您声明该设备(但在此之后,它会报告接口1不可用,以及0或2)。
发布于 2016-12-20 20:41:22
选择配置后,您可以在device.configuration.interfaces[0].interfaceNumber中找到正确的接口编号
device.open()
.then(() => device.selectConfiguration(1))
.then(() => device.claimInterface(device.configuration.interfaces[0].interfaceNumber))https://stackoverflow.com/questions/40996858
复制相似问题