Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

libusb: error [op_open] getcap failed in C++ on Linux

I am running into trouble calling libusb_open in C++ on Linux (running on Raspberry Pi but virtualized to x86 using Exagear).

I can find a device using libusb_get_device_list but it appears translating a device to a device handler using libusb_open is causing problems, even though it returns a 0 (success), however no further commands work. It is giving me the error:

libusb: error [op_open] getcap failed (22)

UPDATE

A little bit of digging has revealed that the following command is producing the error (within libusb):

r = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps);

where IOCTL_USBFS_GET_CAPABILITIES is _IOR('U', 26, __u32). Digging has revealed that error 22 from ioctl is an invalid argument. I'm still trying to unpick this, but any help here is greatly appreciated.

question from:https://stackoverflow.com/questions/41504792/libusb-error-op-open-getcap-failed-in-c-on-linux

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...