Limited support for Suunto DM4

Miika Turkia miika.turkia at gmail.com
Tue Mar 5 09:27:13 PST 2013


On Tue, Mar 5, 2013 at 7:02 PM, Amit Chaudhuri
<amit.k.chaudhuri at gmail.com> wrote:
> Hi Miika,
>
> I've just noticed your interesting work on DM4. Thanks for the user-manual
> additions; they allowed me to locate the file on my Mac and to query the
> database schema.
>
> I've not had a proper play but it looks to me like the code to query the
> database is skeleton only at this stage.  I don't see any calls to step
> through the results of the selections.  Have I got the wrong end of the
> stick here?

The sqlite3_exec registeres a callback (function: dm4_events) that is
called for every row returned by the sql query. So the results are
processed already. For the events there is another callback that
processes them.

As far as I have tested the import, it works for all the basic stuff.
So it is quite usable already.

> Any idea why they are using BLOBs like TemperatureBLOB?

No idea whatsoever.

> I can see some todo:s ... is this something you would like any help with or
> are you set fair? I'm working with sqlite myself a bit these days.

There are two todo items. One is calculating SHA1 for the deviceid.
That would require refactoring the code to call the already existing
sha1 function with proper parameters.

The other one is for multiple cylinder support. This would require
sample DB that has dives with multiple cylinders in it. I do not have
currently such sample so I cannot work on it.

One more thing that should be done is to get more event/alarm IDs
supported. I was actually thinking about generating event IDs to the
Mark table and opening the "fixed" DB with DM4 to see what they are
called. And just add them to the switch clause.

Feel free to do any of these. I am currently fixing a bug in our XSLT
import. Seems that Windows does not handle floating numbers properly
(truncates the decimal part)...

miika


More information about the subsurface mailing list