[PATCH 0/2] Clean up some of the dive computer nickname code

Linus Torvalds torvalds at linux-foundation.org
Wed Jan 9 16:14:21 PST 2013


On Wed, Jan 9, 2013 at 3:10 PM, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> IOW, the serial numbers libdivecomputer gives us are useless. You
> could perhaps turn them into an actual serial number string on a
> per-vendor (or per-device) basis, if you know the vendor rules. The
> Suunto vendor rules *seem* to be pretty simple, based on the two
> devices I have (the Vyper Air clearly uses the same encoding, giving
> another 8-byte string). Other dive computers? Who knows?

Here's a patch for subsurface that hacks in the Suunto rules, and can
thus save serial number and firmware version information for Suunto
dive computers.

It should be done by libdivecomputer, but hey, in the meantime this at
least shows the concept. And helps test the XML save/restore code.

It depends on the two patches that create the whole "device.c"
infrastructure, of course. With this, my dive file ends up having the
settings section look like this:

  <divecomputerid model='Suunto Vyper Air' deviceid='d4629110'
serial='01201094' firmware='1.1.22'/>
  <divecomputerid model='Suunto HelO2' deviceid='995dd566'
serial='23500027' firmware='1.0.4'/>

where the format of the firmware version is something I guessed at,
but it was the obvious choice (again, it's byte-based, I'm ignoring
the high byte that is zero for both of my Suuntos).

                        Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 7500 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130109/3fad8363/attachment.obj>


More information about the subsurface mailing list