问题
测试机是uos系统,测试设备通过两根usb线与测试机相连,其中一根连接正常,另一根却无法链接。
后来在调试模式下,发现应用程序输出窗口打出如下信息:
_get_usbfs_fd libusb couldn’t open the usb 权限不够
解决办法
根据网上提供的思路,该现象产生的原因是设备访问具有一定权限,当前用户没有对该设备的访问权限。所以解决思路有三种:1)提升用户权限,以root用户身份登录,访问;2)配置系统,使设备对所有用户开放访问权限;通过在/etc/udev/rulers.d/下添加新规则实现;3)修改libusb的代码;
本人选择思路2)。
方法1
I think the best way to do this is to create a udev rules file for your devices. Simply create a text file names something like myVendor.rules and put the following text in it (where 1234 is your vendor ID:
SUBSYSTEM=="usb", ATTRS{
idVendor