|
From: Kustaa N. <Kus...@pl...> - 2009-10-12 03:48:58
|
Thanks Allen for suggestion, unfortunately this did not fix the problem. I tried commenting out the set configuration and also tried it with value 1 and I tried moving the detach kernel drive call earlier. Done this before and tried again. Just the same, no such directory. The first time I run with the detach I get no such directory at claim interface, the second time run I get no route to host at the detach which condition disappears if I re plug the device. Im stumped. Incidentally the exact same code works on Mac OS, (apart from the detach) haven't tried Windows yet. I don't get this to work soon I need to skip Linux which would be a real pity as it would be the ideal OS for this sort of standalone low performance server application I'm doing. br Kusti ________________________________________ From: Alan Stern [st...@ro...] Sent: Monday, October 12, 2009 4:49 AM To: Kustaa Nyholm Cc: lib...@li... Subject: Re: [Libusb-devel] Still can't claim interface, "No such file or directory" On Sun, 11 Oct 2009, Kustaa Nyholm wrote: > Hi Alan, > > thanks for responding. > > Below is some output/code. . > USB_device device = findDevice(0x0FDE, 0xCA01, -1); //Ohio scientific > assertOk(device != null ? 0 : NON_STD_ERR, "findDevice"); > > USB_dev_handle dev = usb_open(device); > assertOk(dev != null ? 0 : NON_STD_ERR, "usb_open"); > > //ret = usb_detach_kernel_driver_np(dev, 0); > //assertOk(ret, "usb_detach_kernel_driver_np"); > > ret = usb_set_configuration(dev, 0); > assertOk(ret, "usb_set_configuration"); > > //ret = usb_claim_interface(dev, 0); > assertOk(ret, "usb_claim_interface"); . The problem is easy to fix. You should not call usb_set_configuration() -- especially with a configuration value of 0. If you do insist on calling it, then the configuration value (the second argument) must be 1 and you should call it _before_ calling usb_detach_kernel_driver_np(), not after. Alan Stern |