Testing serial_ftdi.c for various FTDI chip based divecomputers

Venkatesh Shukla venkatesh.shukla.eee11 at iitbhu.ac.in
Sat Jun 7 01:44:09 PDT 2014


On Sat, Jun 7, 2014 at 11:39 AM, Jef Driesen <jef at libdivecomputer.org>
wrote:

> On 07-06-14 05:59, Venkatesh Shukla wrote:
>
>> I have prepared serial_ftdi.c for usage on android devices.  It uses
>> libftdi1
>> for all communications with the dive computer. While building for
>> android, this
>> would be used instead of serial_posix.c I have been testing it on my
>> system
>> using Heinrichs Weikamp OSTC 3. As I do not have access to other ftdi
>> based
>> divecomputers, I could not thoroughly check my implementation.
>> I am attaching universal binary which is compiled using serial_ftdi.c. If
>> you
>> have a divecomputer which uses ftdi chip, I would request you to test
>> downloading of dives using this binary. For reference, the command would
>> be like
>> this
>>
>> ./universal -b ostc3 -n 'Heinrichs Weikamp OSTC 3' -l import.log -d
>> dives.xml
>>
>
> The only ftdi based devices I have available for testing myself are HW
> OSTC2 and OSTC3.
>
> I didn't had time to review or try your work yet, but it's on my todo
> list. Is the serial_ftdi.c you used to compile the same as in your
> libdivecomputer github repository?
>

Yes, it is the same. I have updated it for custom pid. Here
<https://github.com/venkateshshukla/libdivecomputer/blob/android-experiments/src/serial_ftdi.c>
is the link.


> Note: I can produce Windows and Mac OS X binaries if someone needs them.
>
>
>  Do note, the above binary only takes in account PIDs 0x6001, 0x6010 and
>> 0x6011.
>>
>
> Several manufacturers (Suunto, Oceanic, et) use custom VID/PID's. I
> suggest you add those as well, to increase your pool of potential testers.
> I maintain an (incomplete) overview with the known VID/PID's here:
>
> http://www.libdivecomputer.org/drivers.html


I have added those present on the link above. The updated binary is
attached.​
The vid and pid of attached usb device can be found by running lsusb
command on linux. If it has VID 0403 of FTDI ltd , you may test using this
binary.
Running lsusb on my system gives this output for HW OSTC3

Bus 003 Device 018: ID 0403:6001 Future Technology Devices International,
Ltd FT232 USB-Serial (UART) IC



>
>  If this works, then the only link remaining to enable download of dives on
>> android would be getting permission from user using it to access the
>> device. I
>> have tested the script on android emulator as a root user. It works
>> perfectly.
>> But the same thing should be possible without root access. I am facing
>> some
>> difficulty in this regard. I'll let you know as soon as I resolve it.
>>>> universal
>> <https://docs.google.com/file/d/0B2ZBIyX17_BFVTAzTHFuQ2FVV2c/edit?usp=
>> drive_web>
>>
>
> Another thing we'll have to address some way or another is the difference
> in arguments in the normal and ftdi serial implementations. The first one
> accepts a filename, while the latter will probably end up accepting a
> VID/PID (or whatever, but certainly not a filename).
>
>
Agreed. I think it should be PID. Currently it ignores the filename. Hence
you do not need to provide path when running universal. ( ./universal -n
name -b backend -d dives.xml is enough). serial_ftdi.c t loops over all
accepted PIDs to find if any of them matches.

-- 
Venkatesh Shukla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140607/5492560d/attachment.html>


More information about the subsurface mailing list