When downloading from a dive computer, stop at mergeable dives

Jef Driesen jefdriesen at telenet.be
Wed Nov 21 08:56:04 PST 2012


On 2012-11-20 02:31, Linus Torvalds wrote:
> We do want to have some way of saying "force download of all dives
> from today" or something like that, I suspect. Because while I don't
> want to re-download *every* dive, I might want to force-merge the 
> last
> <N> dives.

Have you considered using the libdivecomputer fingerprint feature for 
this purpose? It has been explicitly designed for this scenario. It 
supports multiple devices out-of-the box, without needing any sort of 
heuristics like matching start times. It will also give you the shortest 
possible download times, something which is not always possible to 
achieve with a custom implementation.

Anyway, if you want to play with this feature, have a look at the "-c" 
option of the universal application. In a multi device scenario, you 
download both devices with the command:

./universal -c <cachedir> -d <xmlfile> -b <backend> <devname>

The fingerprint of the most recent dive will get stored in the 
cachedir. When you run the same command again, it will load this 
fingerprint again and only download the new dives (if any of course). 
Because the universal app uses a different fingerprint file per device 
(based on the device serial number), you get multi device support for 
free.

Jef



More information about the subsurface mailing list