From owner-freebsd-usb@FreeBSD.ORG Wed Feb 10 08:24:48 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1529106566C for ; Wed, 10 Feb 2010 08:24:48 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.tele2.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 637618FC13 for ; Wed, 10 Feb 2010 08:24:47 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=DgVIUaT0IhsA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=6GooSirkl0Oy0mpO7pkA:9 a=dU0G1PsnZGXByvODaNPsi6ZTltsA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 630328526; Wed, 10 Feb 2010 09:24:46 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 10 Feb 2010 09:23:20 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201002101738.30753.doconnor@gsoft.com.au> In-Reply-To: <201002101738.30753.doconnor@gsoft.com.au> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002100923.20377.hselasky@c2i.net> Cc: Daniel O'Connor Subject: Re: usb_interrupt_read blocks "forever" sometimes X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 08:24:48 -0000 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