libftdi Archives

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

From: Venkatesh Shukla <venkatesh.shukla.eee11@xxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 23 May 2014 16:33:31 +0530
On Fri, May 23, 2014 at 4:26 PM, Uwe Bonnes
<bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>>>> "Venkatesh" == Venkatesh Shukla <venkatesh.shukla.eee11@xxxxxxxxxxxx> 
>>>>>> writes:
>
>     Venkatesh> Hello guys Sorry for bugging you. But I am facing a problem
>     Venkatesh> while using libftdi.
>
>     Venkatesh> I am trying to read data from a divecomputer Heinrichs
>     Venkatesh> Weikamp OSTC3.  It has FT232RL for interfacing.
>
>     Venkatesh> I am using libftdi to achieve that.  The steps to read the
>     Venkatesh> data are
>
>     Venkatesh>  1. Initialise the device 2. Send INIT byte (0xBB) to the
>     Venkatesh> device.  3. The device responds with an echo of the command
>     Venkatesh> (0xBB).  4. The device then sends a READY byte (0x4D). The
>     Venkatesh> device is now ready for the next step.  5. Send the HEADER
>     Venkatesh> (0x61) byte to the device.  6. In response to this, it first
>     Venkatesh> sends an echo (0x61) back to the device.  7. Then it sends
>     Venkatesh> the device headers. This is the data I need. It should be of
>     Venkatesh> 65536 bytes. But I am reading only around 65446 bytes. It is
>     Venkatesh> a serious error.
>
>     Venkatesh> I am new to libftdi and ftdi chips in general. What am I
>     Venkatesh> missing? How can the above stated problem be resolved?
>
> Did you try to do the same from /dev/ttyUSBx? Does the problem happen there
> too?
>
> If you need pure UART functionallity from the FT device, I think the kernel
> driver is the best way.
>
> Bye
>
> --
> Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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.?

-- 
Venkatesh Shukla

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

Current Thread