Device serial numbers [was: Clean up some of the dive computer nickname code]

Jef Driesen jefdriesen at telenet.be
Fri Jan 18 13:40:45 PST 2013


On 2013-01-13 01:01, Dirk Hohndel wrote:
> On Jan 12, 2013, at 3:42 PM, Artur Wroblewski wrote:
>
>> On Thu, Jan 10, 2013 at 8:51 AM, Jef Driesen <jefdriesen at telenet.be> 
>> wrote:
>> [...]
>>> The primary purpose of the serial number in the DC_EVENT_DEVINFO 
>>> event
>>> is to be able to uniquely identify individual devices (e.g. for use 
>>> with
>>> the fingerprint feature).
>>
>> There is nothing, which prevents two dive computers from two 
>> different
>> manufacturers, to have the same serial number, isn't it?
>>
>> Not sure how it works for fingerprint feature, but IMHO it is worth 
>> keeping
>> above in mind before someone starts to use the serial as device 
>> unique
>> identifier.
>
> Absolutely correct. So Subsurface uses the tuple <model,serial> as
> unique identifier.

As long as that "model" includes not only the model number (as reported 
by the DC_EVENT_DEVINFO event), but also the family type, then 
everything is fine. The model number isn't guaranteed to be unique 
across different families (from the same or a different vendor) either. 
For example in the case of the "Suunto Vyper", the model number only 
gives you the "Vyper" part, while the family type will give you the 
"Suunto" part. So you need both.

I'm aware subsurface does this correctly, but since this conversation 
is being cross-posted to the libdivecomputer mailinglist, this info 
applies to other applications too.

BTW, there are some models too, where we can't really tell the 
difference between certain models. That's either because there is no 
model number available, or we just don't know yet where it's stored. An 
example of this are the Mares M1, M2 and Darwin.

Jef


More information about the subsurface mailing list