XML format change

Linus Torvalds torvalds at linux-foundation.org
Fri Jan 4 10:09:59 PST 2013


On Fri, Jan 4, 2013 at 8:24 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Linus, since we now use <model,deviceid> consistently throughout Subsurface to identify a dive computer, wouldn't it be smarter to switch the deviceid code to simply using the serial number?

What's the format of the serial number? Some random string?

More importantly, if Miika wants the serial number today, maybe he
wants the firmware version tomorrow.  The point being, that if you
want details about the dive computer, then they aren't about the
*identity* testing of the dive computer, they are just that - random
details about it.

Which is absolutely something that we don't want to repeat for every
dive. Think about the data structures, not the code.

So I'd suggest solving it by:

 - rename the "struct dcnicknamelist" as just "struct dc_info" (and
export it into dive.h)

 - rename "get_dc_nicknameentry()" as "get_dc_info()"

 - add firmware/serialnumber/whatever entries to the dc_info
structure, and fill them in as we download from the dive computer.

 - save it in the xml in the settings thing, so that one dive computer
is described in *one* place.

That way you can add any information you want, without making the
identity of the dive computer somehow be about that information, and
without replicating it over and over for each dive.

                Linus


More information about the subsurface mailing list