Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Apr 2005 01:12:46 +0200
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
Cc:        David Gilbert <dgilbert@dclg.ca>
Subject:   Re: Tricky USB device.
Message-ID:  <20050408231246.GV96690@cicely12.cicely.de>
In-Reply-To: <42570698.4070205@savvis.net>
References:  <16982.46075.115518.130213@canoe.dclg.ca> <4256B5EB.9080506@savvis.net> <16982.47024.135663.645297@canoe.dclg.ca> <20050408190514.GS96690@cicely12.cicely.de> <16983.465.572693.73195@canoe.dclg.ca> <42570698.4070205@savvis.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 08, 2005 at 03:32:56PM -0700, Maksim Yevmenkin wrote:
> hmm... why even use libusb? cant you just "fd = open("/dev/ugen0.1", 
> O_RDWR);" and then "write(fd, "MK255", 5)" and "read(fd, ...);". note: 
> here i assume ugen0 is the device.
> 
> >I'm also not entirely clear how/when to use usb_interrupt_read()
> >... as many of the commands listed in the manual return data, but
> >usb_inerrupt_write() doesn't seem to allow for data to be returned,
> >but following usb_interrupt_write(), the read will hang.
> 
> i'd guess you have to keep read pipe open at all times. that is what "fd 
> = open("/dev/ugen0.1", O_RDWR);" will do - it will open both read and 
> write pipes (because of O_RDWR).
> 
> then you just
> 
> write(fd, ...);
> read(fd, ...);

select(2) and non-blocking should work with ugen and interrupt endpoints
too.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd@bwct.de                                  info@bwct.de



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