On Thu, Nov 20, 2014 at 01:00:25PM -0800, Linus Torvalds wrote: > > Add similar cases for other dive computer manufacturers as we figure > > out exactly what the encoding actually is. > > And quite frankly, I'd suggest using > > "%04u-%04u", serial / 10000, serial % 10000 > > so that the end result actually matches what the recall for the Cobalt had. > > At *no* point does it make sense to encode it as "0xrandomnoise". > > Of course, the right solution would be to just do this right in > libdivecomputer.c and have libdivecomputer just format the string > right in the first place. Using, say, DC_STRING_FIELD.
Hey, what a brilliant idea. Since we are currently building libdivecomputer from our private branch it should be relatively easy to simply add this for the computers where we know what the answer should look like. And if we "crowd source" this across our developer community that shouldn't be too hard to do. I'll change my code to use the string you show above and have that printed out as debug info - then people can run this and compare it to the serial data that is on the package / on the device. And I can simply add this to our libdivecomputer branch (and send patches to Jef in case he decides to use the string field solution). Does that make sense or am I missing something else? /D _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
