From: Tim R. <ti...@pr...> - 2013-07-31 17:13:18
|
Anton Smirnov wrote: > finally i was able to fix it by removing close(). interface count is > now positive as i printed interface count before they were copied. > now i'm having "device busy" error: > > avrdude: usbdev_open(): error claiming interface 1: Device or resource > busy That says some other app has already claimed that interface. Is this a standard device that might have a standard driver? > i'm trying to claim the right interface (found it using endpoints > count = 2 for my board) of the right device (found it using pid/vid). > interface was not claimed in android app but the device was just > opened to get file descriptor. > > what can effect it? should i close the device before claiming interface? No, you need to get the other owner to release their claim. Why don't you do an "lsusb -vv" and show is the descriptors? > also it fails to set default (0) configuration with the same error > message:avrdude: usbdev_open(): error setting configuration 1: Device > or resource busy Right. Changing the configuration affects existing uses, so it's not allowed unless all of the interfaces are free. Also, I want to caution you a little bit about your terminology. You are setting configuration 1, which happens to be the first (and maybe only) configuration in your descriptors. Although that may be the default (and only) working configuration for your device, USB devices also have an unconfigured state, which is selected by setting configuration 0. So, when you say "set default (0) configuration", it's a little confusing. I can see in your code that you mean element [0] of the config array in your device, but that's configuration 1. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |