libftdi Archives

Subject: Re: Data loss while ftdi_read_data() from FT232RL

From: Rogier Wolff <R.E.Wolff@xxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 27 May 2014 06:46:52 +0200
On Fri, May 23, 2014 at 04:33:31PM +0530, Venkatesh Shukla wrote:

> The library libdivecomputer does use /dev/ttyUSB* efficiently to
> extract data from the device. But I have to do the import part on
> android platform. Android does not provide access to USB devices as
> normal linux systems do, and native code is preferred, I have decided
> to use libftdi for the import part. It does indeed work on the android
> emulator after getting requisite permissions but there is this data
> loss error. Any way out.?

Ah! New information! You're using an emulator inside a host computer!

Does the problem also happen "in real life"? I can very well imagine
that the emulator is occasionally too slow to handle the data before a
buffer overrun happens.

The ftdi chip knows that "libftdi" has not read the data. So it will
try to convince whatever is sending the data to stop. But there is
only so much that it can do: I expect that RTS/CTS are not connected
inside the dive computer meaning that the processor in the dive
computer will simply continue to send data even when the FTDI buffer
fills up.

Can you synchronize in the datastream? Can you download that header
multiple times to see if you're missing the same parts every time?  Or
maybe just download it once correctly using "libdivecomputer"? Compare
the data!

        Roger. 

-- 
** R.E.Wolff@xxxxxxxxxxxx ** http://www.BitWizard.nl/ ** +31-15-2600998 **
**    Delftechpark 26 2628 XH  Delft, The Netherlands. KVK: 27239233    **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread