[libhid-discuss] Searching for multiple hubs using force_open()
shivaprasad javali
jbsp72 at gmail.com
Fri Jun 27 05:53:53 UTC 2008
The design of the application is fixed and in that the way we check whether
any new devices have been added is to cheack the no of devices present every
100ms and then take action after that. Unfortunately I cant change this
design so I cant make use of any notification systems.
I debugged some more into the code and found that the problem sometimes once
in while (may be once every 10-15 tries, this becomes less frequent if I
have two USB devices connected), I get the same handle to the USB device in
two consecutive calls for finding the handles for the USB devices( the OS
should give me a new handle to the USB device every time I read the USB
device) and that is why(because of the logic I have in my code when I get
the same handle on two consecutive device reads), the application thinks
there are no devices connected to it even though there are.
Any thoughts??
Thanks
Shivaprasad
On Thu, Jun 26, 2008 at 6:15 PM, Charles Lepple <clepple at ghz.cc> wrote:
> On Jun 26, 2008, at 8:27 AM, Peter Stuge wrote:
>
> > On Thu, Jun 26, 2008 at 05:54:57PM +0530, shivaprasad javali wrote:
> >> In my application I read the usb busses every 100 ms or so
> >
> > Please make use of some notification system instead. udev, hald or
> > even hotplug. Note that both udev and hotplug are Linux specific.
>
> Indeed.
>
> Also, if it works in a test application, but not in the final
> application, that tells me that you need to rewrite the test
> application so that it better reflects what the final application is
> doing.
>
> --
> Charles Lepple
>
>
>
> _______________________________________________
> libhid-discuss mailing list
> libhid-discuss at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
>
More information about the libhid-discuss
mailing list