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

Artur Wroblewski wrobell at pld-linux.org
Sat Jan 12 16:02:11 PST 2013


On Sat, Jan 12, 2013 at 9:15 PM, Jef Driesen <jefdriesen at telenet.be> wrote:
[...]
> Anyway, we can just fix the decoding of the serial number of course. For the
> fingerprint feature it doesn't have to be decoded correctly, but that does
> mean we can't decode it correctly either (see attached patch). I would
> prefer that instead of adding another callback with a string. A plain number
> is more convenient than a string (I hate string processing), especially for
> things that are numbers. How the number is stored by the device is
> irrelevant. If we ever encounter a serial number that isn't a number or is
> larger than 32 bits, than we can always reconsider.

We deal with two things here
- serial number value as reported by a device - delivered by libdc now
- serial number representation - this one is missed

IMHO, a function/callback returning nicely formatted string is quite good
idea. And it would be great to have both (let's just not mistake them for
device identifiers, see my other e-mail).

Another example of serial numbering, below.

Sensus Ultra reports serial number value as 16-bit unsigned int
i.e. 1234, but it is formatted/represented as U-XXXXX (i.e. U-01234)
on the device itself. Looking at the ReefNet's website[1], the
Sensus Pro's serial number is reported as SP-XXXXX (i.e. SP-01234).

Regards,

w

[1] http://reefnet.ca/products/sensus/tour/photo/


More information about the subsurface mailing list