deviceid

Dirk Hohndel dirk at hohndel.org
Thu Nov 20 07:36:56 PST 2014


So Anton brought this up on trac. And I have been bitten by this myself...

Linus, this code has been around forever, I think this was a very early
design decision that you made:

devdata->deviceid = calculate_sha1(devinfo->model, devinfo->firmware, serial);

Can you remind us, why the firmware version was included in this?

The problem is, of course, that with every firmware update (and those are
becoming much more frequent, as you are seeing yourself), you get a new
deviceid and we redownload all dives :-(

Now of course we can't simply change this, because then EVERYONE gets to
download everything again... So I wonder if there's some scheme that would
allow us not to fail for the common case, but also to get things right in
the future.

The only idea I came up with so far is to add a new field

deviceid2 = calculate_sha(devinfo->model, serial);

If an existing dive doesn't have a deviceid2 stored, we compare with the
old deviceid (so if the firmware didn't change, all is well). And for all
newly downloaded dives, we store both numbers - and if deviceid2 is
available we compare that.

What am I missing with this idea?

/D


More information about the subsurface mailing list