This adds a few finishing touches to actually download dives in the
expected order (newest first), which fixes the handling of already
downloaded dives.
It also adds the fingerprinting code to optimize the downloading a bit.
Finally, it handles cancellation in the middle.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This isn't perfect - we don't do the whole dive fingerprint etc, so
right now it always downloads all dives.
To make matters worse, it downloads dives oldest first, which then
confuses the subsurface downloader that expects newest first.
So there's stuff to clean up, but the basic profile data is all there.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
All of the Oceans S1 protocol seems to be basically ASCII data, but the
bigger chunks of data (the dive list, and the actual dive profiles) are
chunked in 512-byte pieces with sequence numbers and what looks like
some checksum.
This doesn't check the checksum yet, but the basic "download data" seems
to work.
Note that the code doesn't actually _parse_ said data yet, nor create an
actual dive list. So this is very much only very incremental progress,
but this seems to have been the nastiest part of the actual protocol.
Knock wood.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The communication seems to be mainly ASCII strings, with the main
complexity probably being that the Nordic Semi UART has some side
channel for switching between line-buffered and "bulk data" modes.
That part might end up being painful and needing more interfaces to the
Subsurface BLE code.
We'll likely need to add more special BLE code. The Bluetooth SIG
really is a horrible disgrace.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>