Commit graph

12147 commits

Author SHA1 Message Date
Dirk Hohndel
c9c9a8390a QML UI: start BT discovery a tiny bit later
This way the AppLog starts with the name and version of Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
ce21c2a696 QML UI: drop AppLog title and add margin instead
The title was hidden under the title bar, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
a8468caaa2 BLE: minor code cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 01:37:21 -07:00
Alex Blasche
bf3cc2f64b Make compile with Qt developer builds
subsurface/core/divesitehelpers.cpp: In member function 'virtual void ReverseGeoLookupThread::run()':
subsurface/core/divesitehelpers.cpp:128:12: error: invalid use of incomplete type 'class QDebug'
     qDebug() << "no reverse geo lookup; geonames returned\n" << fullReply;
            ^

Signed-off-by: Alex Blasche <alexander.blasche@qt.io>
2017-07-06 12:43:42 +09:00
Alex Blasche
868fb9d5a9 Enable building with standard Qt install path layout
In general this patch enables building of subsurface without being
forced to use the official Qt binary packages. This is particularly helpful
when having to debug Qt internals or having to deal with custom patches
on top of the official Qt releases.

The architecture dependent file path layout is only employed by official
Qt binary packages. They are the result of a reordering at package
generation time. If Qt was build for a single architecture, the standard
layout does not add the architecture specific top level patch for the resulting
binaries.

Signed-off-by: Alex Blasche <alexander.blasche@qt.io>
2017-07-06 12:43:11 +09:00
Alex Blasche
db8200a9c3 Remove obsolete QT5_ANDROID_BIN
Signed-off-by: Alex Blasche <alexander.blasche@qt.io>
2017-07-06 12:43:11 +09:00
Dirk Hohndel
a4bb61b58a BLE download: EON Steel doesn't want to loop over reads
This seems a bit brutal, but it does the trick and makes EON Steel
downloads work again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 09:30:05 -07:00
Dirk Hohndel
8a1f5b9566 BLE: write confirmation isn't HW only
Happens on the Suunto EON Steel as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 09:29:31 -07:00
Guillaume GARDET
2693735bb7 Documentation: Merge and update french translations
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 07:48:28 -07:00
Jan Mulder
3cde4f594d Address code review
Addresses code review by Dirk. No functional changes.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Jan Mulder
709c1df2af BLE: read until no more data in coming in
The current BLE read reads just one 20 bype packet. That packet size is set
in ble_serial_ops, so, without being able to test on anything other than
a OSTC3, I assume that this holds for other BLE DCs too. So, I think is
is weird that those interfaces work with the current read() of just one
packet at the time.

As we need a blocking read (at least for the OSTC parser), just read all
data that is available on the input. And when we think we are done, give
the QtEventloop control to see if there is more, and process that incoming
data as well. All this basically implements a blocking read.

CAVEAT 1: This might break the reading from the currently working BLE devices.

CAVEAT 2: With this, I still cannot read the OSTC3 completely. For
developers familiar with the HW transfer protocol: it just stops while
reading the first full dive (header + profile) command 0x66, despite
correctly reading about 5Kb of data before. For some
reason, I do not believe that this is related to this commit.

CAVEAT 3: All above tested on Linux Desktop with bluez stack, and
confirmed NOT to work on Android 7.1.2, build with Qt 5.9.0, And
yes, I know 5.9.1 recommended.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Jan Mulder
d6b17fef08 OSTC over BLE: filter and track OSTC credit traffic
1) As the OSTC sends data to the BLE central role (the SSRF client) over 2
characteristics, we have to filter the administrative credit data from
the actual dive data that it received. The characteristcStateChanged
function is adapted for this.

2) We have to be sure that the Terminal Client I/O is fully defined during
opening the connecton to the OSTC. From 6d505b24f0c15 we can see
that the last step in setting up the terminal interface is the grant
of credits. This is done by writing to the proper (the only one, with
id = 0x2902) descriptor of the credits RX characteristic. The here
added slot is triggered on the completion of write of credits marking
the final stage of the setup.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Jan Mulder
6031692a39 Use waitFor instead of timer
See e79bede0aa. We rather use wait in combination
with spinning the event loop.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Jan Mulder
f6768cedf3 OSTC over BLE: Select the right service
The current "select the correct BLE service to talk to" is flawed.
It assumes that the first found non-standard UUID is the right one
and apparently it is for some DCs. But not for the HW devices.
The HW devices use a "standard" ie. approved by the Bluetooth
SIG, controller, that comes with a UUID that our code currently
considers standard so not to be the right one.

This (simple) commit selects the right service for HW. The UUID
is hard coded, and this is ok, because it is tied to the hardware
used by HW. Futher, it does not change anything for other BLE
devices.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Jan Mulder
6fe0388b96 OSTC over BLE: initialize Terminal I/O client
This initalizes the Terminal I/O client as described in paragraph 3 of
http://www.telit.com/fileadmin/user_upload/products/Downloads/sr-rf/BlueMod/TIO_Implementation_Guide_r04.pdf

This is for all Heinrichs Weikamp computers, that use referenced BT/BLE hardware
module from Telit Wireless Solutions (Formerly Stollmann E+V GmbH). The 16 bit
UUID 0xFEFB (or a derived 128 bit UUID starting with 0x0000FEFB is a
clear indication that the OSTC is equipped with this BT/BLE hardware.
Furthermore, most devices equipped with this BT/BLE hardware have BT addresses
starting with 00:80:25:...

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 23:46:07 +09:00
Dirk Hohndel
40d85b5d63 Fix the failing bundle signature on Mac
So THAT was why we had moved the plugins...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 22:36:39 -07:00
Dirk Hohndel
bc1a313c9f Increase the BLE timeout to 12 seconds
This seems really long, but one user appeared to get a response after
almost 10 seconds. So going with 12 for some margin of error.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 22:22:16 -07:00
Dirk Hohndel
345e063eb5 Rewrite the matching code for BT devices
This should be much more robust in getting us the correct Bluetooth address
and the correct vendor / product for our selection.

When we pick a paired device, we extract the address right from its name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 21:58:26 -07:00
Dirk Hohndel
bc864c3bce Don't add all discovered BT devices
This really doesn't help us as we can't associate a vendor/product with
devices we don't recognize, so we can't download from them, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 21:58:26 -07:00
Dirk Hohndel
016b19ef0c Subsurface-mobile version jump to 2.0
The beginning of download (plus the UI overhaul) definitely deserve
a major version bump.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 21:58:26 -07:00
Seamus Boyle
252dfaf6d1 TestPreferences: Fix update manager test date
QDate::addDays() returns a copy with the changed date, calling it and
ignoring the return value does nothing.

Signed-off-by: Seamus Boyle <seamus@beantrader.com.au>
2017-07-04 11:54:54 +09:00
Robert C. Helling
d17bb6318e Don't try to dereference empty product/vendor list
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-04 07:06:20 +09:00
Dirk Hohndel
8467e53f11 Android: add Suunto EON Steel as device
This way plugging in an EON Steel should pop up a question if the
user wants to open Subsurface-mobile. Unfortunately, the download
doesn't work, yet, and worse, if the phone goes to sleep while an
EON Steel is plugged in, this appears to trigger a hard crash on
the EON Steel.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 15:05:45 -07:00
Robert C. Helling
bdd1a35c01 Add new sources to ios .pro file
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-04 06:12:09 +09:00
Jan Mulder
d7b8ad7a44 BT discovery Android: Allow BT/LE devices connect both ways
For DCs that support both BT and LE, allow the user to connect to both
interface layers. Maybe not usefull in the end (as BT is faster
than LE), but as long as BT on Android is WIP is it very useful
to be able to connect to the interface layer we like.

Just add it to the Paired Devices list twice. The normal way, and
the LE: prepend way.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-04 05:49:52 +09:00
Dirk Hohndel
096682cd94 Whitespace
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 13:48:54 -07:00
Dirk Hohndel
60123515b6 Fix '-L-lcurl' linker warning
This would happen if we don't have a specific directory in LIBSSH2_LIBRARY_DIRS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 13:47:23 -07:00
Dirk Hohndel
7a6cc12da2 Mac packaging - don't move Grantlee plugins
I don't know why we moved them from the 5.0 subdirectory, but that
seems to break things now. Odd.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 13:30:10 -07:00
Dirk Hohndel
65f6db6e2c Don't warn about missing en-US translation for Qt
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03 13:29:25 -07:00
Dirk Hohndel
20254a43c0 Mac packaging: don't lose minimum version
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 03:56:51 +09:00
Dirk Hohndel
bd18b6b88f build.sh: add option to build all dependencies
Using the Homebrew dependencies is much easier and faster, but then
we run into the problem that Homebrew always builds against your current
OSX version. This instead allows us to build the dependencies ourselves
and set the SDK / minimum OSX version. This is mainly important for
binaries that we want to distribute.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 01:45:55 +09:00
Dirk Hohndel
acee6f4bec build.sh: build against older SDK / minimum OSX version
On Mac we want to make sure that we don't only run on the OS that
we were built on, but all the way back to 10.10 (that's the oldest
that Qt supports).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 01:45:55 +09:00
Dirk Hohndel
36d462e0f9 build.sh: don't override existing CMAKE_PREFIX_PATH
If we already explicitly point at one Qt installation, don't override
with another one.

Also, support all the way up to Qt 5.9.1

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 01:45:55 +09:00
Dirk Hohndel
6bba524288 Mac package build: adjust handling of libgit2
Apparently it now is a different dependency that causes problems.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 01:45:55 +09:00
Dirk Hohndel
9c0cc53175 Mac package build: remove obsolete hack
And also add some additional comments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-04 01:45:55 +09:00
Dirk Hohndel
0482f054a7 QML UI: add more dive computers
This really needs to be done differently - we need a structured way
to associate a transport mechanism with each of the dive computers
we support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-02 21:57:08 -07:00
Dirk Hohndel
1e895095cf Update SupportedDivecomputers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-02 20:57:54 -07:00
Dirk Hohndel
339f128cdc MXE cross build: allow to specify mxe directory
This should make it easier to test different mxe versions.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-02 18:56:18 -07:00
Dirk Hohndel
7199ad33e2 BT discovery: detect Scubapro G2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-02 18:32:16 -07:00
Dirk Hohndel
6451adfec1 Android build: switch to Qt 5.9.1
It seems that the Qt team deviated from their previous practice to keep
the Qt/x.y directory structure the same for all minor releases - so now
it is indeed Qt/5.9.1
Oh well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30 17:21:07 -07:00
Dirk Hohndel
4604b6a8de BLE: require Qt 5.6 and suggest Qt 5.9.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30 16:55:53 -07:00
Dirk Hohndel
61fff71391 Android: mark BLE only paired devices
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30 13:13:38 -07:00
Dirk Hohndel
c145cbd754 QML UI: save BT address as string
And do the same LE: prefix marking as in the desktop version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30 13:12:53 -07:00
Dirk Hohndel
6837120bb1 BLE handling: create helper function to add the LE: prefix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-30 13:12:07 -07:00
Dirk Hohndel
a4d4d1c83b Better colors for BT pairing dialog
Linus had complained about these colors for a while. I think
this is a massive improvement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29 15:19:33 -07:00
Dirk Hohndel
f4f42a0b97 Don't crash trying to record zero dives
If the user clicks "Accept" when no dives were downloaded we would otherwise
dereference unitialized memory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29 15:10:42 -07:00
Dirk Hohndel
282698e5d2 QML UI: disable reachability mode
Latest Kirigami master allows us to turn off reachability mode. In
general this had been rather confusing to our users and it seems to
somewhat conflict with the pull down to refresh of the dive list.

Latest Kirigami also changes the behavior of refresh slightly, you now
need to pull "down" for at least 500ms before it triggers. So, with this
change and the latest Kirigami, hopefully the user experience for
refresh is good enough that we can consider keeping it enabled and use
it as an equivalent to manual sync (even in offline mode).

See #454
See #456

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29 15:10:42 -07:00
Robert C. Helling
81362e6441 BT address 0 is bogus
Grey out those devices in the scanning list and prevent
the user from selecting those.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-06-30 07:10:32 +09:00
Jan Mulder
d6446569af QML UI: only drag a pull down sync, and not flick it
Fast flicking to the top of the divelist triggers almost certainly a
pull down sync, as the default boundBehavior is DragAndOvershootBounds.
Despite being the default QML action, this leads to unwanted pull
down syncs (even in offline mode).

Setting the boundBehavior to DragOverBounds solves this issue. Now,
the user has to explicitly drag the top down to force a pull down
sync, and a accidental fast flick is stopped at the upper bound.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-29 23:21:55 +09:00
Dirk Hohndel
b459ccbff7 QML UI: DiveList: make download from DC main action
Now that we support this for many dive computers, that seem reasonable.
I'm not happy with the icon, but couldn't figure out a better one in the
breeze icon set.

See #426

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-27 22:18:26 -07:00