|
From: Dave H. <DAV...@ni...> - 2007-06-20 07:08:27
|
> -----Original Message-----
> From: lib...@li...=20
> [mailto:lib...@li...] On=20
> Behalf Of Kjell Eirik Andersen
> Sent: 2007 June 20 07:53
> To: lib...@li...
> Subject: Re: [Libusb-win32-devel] Libusb-win32-devel Digest,=20
> Vol 13, Issue 16
>=20
> Hi Dave !
>=20
> Thanks for your answer. I don't really see how the length of=20
> the timeout
> makes any difference. The application in question does=20
> already run in a
> separate thread and a FIFO is used for the data received. The=20
> timing gap
> I'm trying to close with the ping-pong solution is from the=20
> point where
> usb_bulk_read() returns with data to the point in time where
> usb_bulk_read() is entered again.
Yes, there is a problem AFAIUI. The best that can be done at
present is for the read thread to transfer its data to the
FIFO and immediately begin the next read. The problem is that
the gap is of course non-zero, so it appears possible for data
to be lost during that time.
It's not a system that you'd stake your life on :-(
We have a small USB device embedded in one of our products.
This device can be reprogrammed in-application. My worst
nightmare is that data loss will occur out in the field
during reprogramming and turn the machine into a brick.
It will be expensive to recover.
> I have also noticed that libusb (or is it windows usb subsystem ?)
> actually buffers data, but I have no idea of the size of the=20
> buffers...
I don't know. However, I'd suggest that it would be useful
to have a FIFO built in to libusb at low level so that data
loss can't happen. I don't mind whether the calling programme
mallocs the space and passes it to libusb, or the calling
programme requests libusb to reserve it itself.
Unless someone has a neater way to avoid data loss?
Dave
***************************************************************************=
***************************************************************************=
***************************************************************************=
****************
NICE CTI Systems UK Limited ("NICE") is registered in England under company=
number, 3403044. The registered office of NICE is at Tollbar Way, Hedge E=
nd, Southampton, Hampshire SO30 2ZP.
Confidentiality: This communication and any attachments are intended for th=
e above-named persons only and may be confidential and/or legally privilege=
d. Any opinions expressed in this communication are not necessarily those o=
f NICE. If this communication has come to you in error you must take no act=
ion based on it, nor must you copy or show it to anyone; please delete/dest=
roy and inform the sender by e-mail immediately.
Monitoring: NICE may monitor incoming and outgoing e-mails.
Viruses: Although we have taken steps toward ensuring that this e-mail and=
attachments are free from any virus, we advise that in keeping with good c=
omputing practice the recipient should ensure they are actually virus free.
***************************************************************************=
***************************************************************************=
***************************************************************************=
*******************
=20
|