Let's show the units in CSV header so the actual fields have only the
values. This should be easier to parse with some other programs.
Fixes#472
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Apparently, OSTC Sport has a BT name like OSTCs<space><serial>.
Small code addition to detect this properly. As long as we
do not have an improved way of detection. Notice that most of
the HWs use the same BT hardware, so simple detection on offered
services will not work.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Email addresses are checked for a someone useful pattern, passwords are
letters, numbers, and +-_. only. Reject anything else.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This hides the text for the map it button if ther are no coordinates for a dive. Needed as for the dark theme the map it text was still visible.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This adds the right handle icon that is needed for the swipe list items not to report an error when activated.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Right now we need to restart Subsurface-mobile in order to detect
Bluetooth devices - so simply turning on BT after Subsurface-mobile was
started is not sufficient.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Doing a manual merge from the command line in order to retain Jan's SHAs
so that the commit message makes sense...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
See also b409e9fc91 and 709c1df2af. The OSTC parser
cannot handle reads of single 20 byte BLE packages in serial mode.
Instead of doing a deeper down agressive read, we can read on
the serial level more subtile. As the parser is requesting a
specific number of bytes, we just read that number of bytes and
return them. As the 20 byte BLE packets do (obviously) not
align with the reading requirement of the libdc parser, a little
housekeeing needs to be done in between individual reads.
CAVEAT 1: In contradiction to 709c1df2af, this is supposed to
work for all parsers that properly specify the needed bytes to fetch.
CAVEAT 2: All above tested on Linux Desktop with bluez stack.
Subsurface mobile is step 2.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Commit 709c1df2af introduced a hard blocking read for BLE devices.
This did break BLE reads from multiple DCs, and (in hindsight) was not
a correct implementation. It would require, for example, dynamic
read buffers as especially profile data grows with dive time, and
in addition, and more importantly, also the OSTC libdc parser cannot
process the entire profile of a dive at once (but likes to receive
it in 1K blocks). So, basically, it introduced issues, and did not
solve the OSTC read.
This commit reverts this hard blocking read (and as such will break
OSTC BLE reads). But it enables removal of the special cases for
the EON Steel and G2.
A next commit will solve OSTC BLE reads.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Handle credits. Do not just ask for maximum credits all the time as this
will stop the download. Also do not let the credits go back to 0 (while
this might work, this is not tested). Getting back the 0 credits stops
the download, and even when it can be restarted, it is less efficient
(and not needed). Notice also that it takes some time before a grant
request is honoured. During testing I saw reception of up to 25 packets
between request and grant. So a lower bound for the request of
32 packets seems resonable.
One aspect the Telit/Stollmann TIO puzzeled me. Sections 4.1 and 4.2
both talk about credits, but my hyphothesis is that there are two
credits counters in play. One for traffic either way. This commit
only deals with credits granted by Subsurface to the OSTC to send
data. Credits granted by the OSTC to allow Subsurface to send new
commands is NOT part of this commit, and is seemingly not needed
in our scenario. As we only send new commands to the OSTC when
a previous one is finished (per HW's interface spec), the OSTC
does not run out of credits to receive commands.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit only has the actual changes, the next commit will clean up
the white space in order to make it more obvious what was done.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The trick is to pick a path that is accessible from other applications.
In theory QStandardPaths::GenericDataLocation should provide that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While it's nice to have the numerical model in the logfile,
on the screen the user wants to see the dive computer product
name. And none of those hex numbers that make the text so long
that it becomes useless.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These buttons only work when we successfully downloaded a dive. Also, don't
show a list of dives when there are no dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
To be shared between C/C++ and QML code in order to show the updates
and potential error messages from libdivecomputer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This reverts commit ed43b5dced ("Add
support for tank sensor battery for Perdix AI") since a much better
solution to get to that information has been implemented in
libdivecomputer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We use a little script to create the code snippet. This script in return
relies on comments that were added to the latest libdivecomputer source
(in the Subsurface-branch).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
[Dirk Hohndel: collapsed all of the commits into one]
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit awkward with a VENDOR event - but at the time the strings
are generated, we don't have the information, yet, that we need to
determine these values (we need the last sample parsed, but the strings
are created as part of the dive headers.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>