7 Commits

Author SHA1 Message Date
Dirk Hohndel
a004fdffed fix some coverity errors
CID 350142: Resource leak
CID 350154: Resource leak
CID 360641: Resource leak
CID 350147: Possibly not null-terminated strings

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-21 12:05:57 -07:00
Linus Torvalds
8d17c3c01c Oceans S1: polish up the downloading logic for usability
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>
2020-06-25 10:40:41 -07:00
Linus Torvalds
da8ae52b50 Oceans S1: actually download all dives and parse them
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>
2020-06-24 17:09:34 -07:00
Linus Torvalds
91658dd167 Oceans S1: fill out core download protocol details
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>
2020-06-24 14:18:57 -07:00
Linus Torvalds
ae58a66d9a Oceans S1: start filling in protocol details
This does the time sync command, which is particularly simple.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-23 15:45:27 -07:00
Linus Torvalds
7018206f56 Oceans S1: start documenting the download format and first packets
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>
2020-06-23 14:28:44 -07:00
Linus Torvalds
d58b8f6928 Add skeleton for Oceans S1 downloader
This does nothing, but fills in all the basic boiler plate code and data
structures.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-23 13:28:10 -07:00