diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-20 17:59:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-06-20 18:39:21 -0700 |
commit | d918289a0456230788a4135721eaf995b41c9950 (patch) | |
tree | 33f89150d7174b344fdf5472daf5cbae2f3b78df /Documentation/mobile-manual.txt | |
parent | 41e5f23002fff0fa300d7a7a699811454881d1e3 (diff) | |
download | subsurface-d918289a0456230788a4135721eaf995b41c9950.tar.gz |
Preferentially use existing device ID when setting serial number
We have two different models for setting the deviceid associated with a
dive computer: either take the value from the libdivecomputer 'devinfo'
field (from the DC_EVENT_DEVINFO event), or generate the device ID by
just hashing the serial number string.
The one thing we do *not* want to have, is to use both methods, so that
the same device generates different device IDs. Because then we'll
think we have two different dive computers even though they are one and
the same.
Usually, this is not an issue, because libdivecomputer either sends the
DEVINFO event or gives us the serial number string, and we'll always
just pick one or the other.
However, in the case of at least the Suunto EON Steel, I intentionally
did *not* send the DC_EVENT_DEVINFO event, because it gives no useful
information. We used the serial number string to generate a device ID,
and everything was fine.
However, in commit d40cdb4755ee ("Add the devinfo event") in the
libdivecomputer tree, Jeff started generating those DC_EVENT_DEVINFO
events for the EON Steel too, and suddenly subsurface would start using
a device ID based on that instead.
The situation is inherently ambiguous - for the EON Steel, we want to
use the hash of the serial number (because that is what we've
historically done), but other dive computers might want to use the
DEVINFO data (because that is what _those_ backends have historically
done, even if they might also implement the new serial string model).
This commit makes subsurface resolve this ambiguity by simply preferring
whatever previous device ID it has associated with that particular
serial number string. If you have no previous device IDs, it doesn't
matter which one you pick.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Documentation/mobile-manual.txt')
0 files changed, 0 insertions, 0 deletions