воскресенье, 24 марта 2013 г.

V-USB. AVR. LibUSB. Ubuntu

Откомпилировал я прогу hidtool, которая идет в примерах библиотеки V-USB, и столкнулся с такой ошибкой (в виндовсе такого нет):

Error sending message: error sending control message: Device or resource busy
error writing data: Communication error with device
Ответ был найден здесь: http://forums.obdev.at/viewtopic.php?t=1474 .

Упрошенный вид кода таков:
usb_set_configuration(dev, 1);
while(usb_claim_interface(dev, 0)!= 0){
    if(usb_detach_kernel_driver_np(dev, 0)<0) printf("Error 123");
}
Вписывается он после: dev = openDevice();
Возникает потому что:

Postby christian » Wed May 28, 2008 5:22 pm
The first error indicates that Linux insists that you claim an interface. That's somewhat strange, since it should be possible to query the device's string descriptors (through endpoint 0) when the device is otherwise busy.
Полезные ссылки:
http://codebot.wordpress.com/2010/01/05/libusb-dokumentaciya/
http://microsin.ru/content/view/955/44/

Комментариев нет:

Отправить комментарий