Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2010 09:23:20 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        Daniel O'Connor <doconnor@gsoft.com.au>
Subject:   Re: usb_interrupt_read blocks "forever" sometimes
Message-ID:  <201002100923.20377.hselasky@c2i.net>
In-Reply-To: <201002101738.30753.doconnor@gsoft.com.au>
References:  <201002101738.30753.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 10 February 2010 08:08:08 Daniel O'Connor wrote:
> I am trying to talk to my WH1080 weather station and I find that
> sometimes when I start the program it will stall forever in
> usb_interrupt_read even though the timeout specified is 50 milliseconds.
> 
> I also tried using alarm() but that doesn't cause the transfer to abort
> (it appears the libusb code loops and doesn't check for EINTR).
> 

Hi,

I would not recommend using signals with libusb. It is not portable. Currently 
signals are ignored. What you would have to do, is to use the timeout argument 
which you are doing, and have a timekeeper variable somewhere, or create 
another thread. Still, when using the timeout there is a chance you can loose 
data.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002100923.20377.hselasky>