Commit graph

13833 commits

Author SHA1 Message Date
Dirk Hohndel
e9fd4cb7dc Android: correctly detect the different BT device types
The previous code would not add the non-LE address for dual stack
devices. Unfortunately, even with this fix we still don't get the
correct result for the dual stack Shearwater Petrel 2 that I have
for testing as Android incorrectly reports it as a BLE-only device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 16:02:17 -07:00
Dirk Hohndel
ddd5ec7f56 Android: fix error in build script
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 14:49:15 -07:00
Dirk Hohndel
b9e57dbeab iOS: fix typo in build script
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:54:01 -07:00
Dirk Hohndel
028299193a Create one function to determine the supported transports
This should make sure we create a consistent view based on all the
information available.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Dirk Hohndel
5faa167e9f libdc transport debugging
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Dirk Hohndel
ea7a7c6b24 QML UI: add supported dive computers to log file
In a more compact format than before.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Dirk Hohndel
36749b28d9 Redesign the flow for checking supported DCs on Android
Only filter against the hard coded list if no other supported transports
are available for a dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Dirk Hohndel
0cacb06d80 Use libdc information about supported transports
For example, even on platforms that support libusb, libdivecomputer
might be compiled without such support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Dirk Hohndel
1dfac4cb74 Android: rebuild libdivecomputer if SHA changes
Just like we already do for iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-27 11:52:48 -07:00
Linus Torvalds
901991afbe Do a better job of picking which transport to use
If the user specified bluetooth, we really should pick bluetooth, not
probe and possibly fall back to something else.

We should also honor the users choice of BLE vs classic BT.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-27 11:52:13 -07:00
Anton Lundin
fd359f5a88 Configure ostc3: Remove obsoleted setting
In firmware version 2.97 the setting 0x38, SETPOINT FALLBACK, has bin
obsoleted and we get a error when trying to write to it.

This removes this setting.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-04-27 21:33:47 +03:00
Dirk Hohndel
6582896e7f Update references to Subsurface-NG
We switched branch names for our own flavor of libdivecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-25 08:37:31 -07:00
Dirk Hohndel
b930c39ead Compile fix when compiling without BLE enabled
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-25 07:56:19 -07:00
Dirk Hohndel
c5e4086820 Only offer dive computers with supported transports
On Android we still need to do more filtering as only some of the USB
divecomputers are supported. But on iOS this takes care of it without
the hard coded list.

Additionally, if built without BT or BLE support, the corresponding dive
computers are no longer shown (e.g. Perdix AI on Windows).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 18:02:51 -07:00
Dirk Hohndel
0aa87687a8 Update libdivecomputer submodule
This is the flag-day update that goes along with the last three patches.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 17:55:29 -07:00
Linus Torvalds
c60d2ec3e3 use libdivecomputer 'fingerprint' to avoid downloading extra data
This opportunistically uses a cache of 'fingerprints' for already
downloaded dives.

As we download data from a dive computer, we save the fingerprint and
dive ID of the most recent dive in a per-divecopmputer fingerprint cache
file.

The next time we download from that dive computer, we will load the
cache file for that dive computer if it exists, verify that we still
have the dive that is referenced in that cachefile, and if so use the
fingerprint to let libdivecomputer potentially stop downloading dives
early.

This doesn't much matter for most dive computers, but some (like the
Scubapro G2) are not able to download one dive at a time, and need the
fingerprint to avoid doing a full dump.  That is particularly noticeable
over bluetooth, where a full dump can be very slow.

NOTE! The fingerprint cache is a separate entity from the dive log
itself.  Unlike the dive log, it doesn't synchronize over the cloud, so
if you download using different clients (say, your phone and your
laptop), the fingerprint cache entries are per device.

So you may still end up downloading dives you already have, because the
fingerprint code basically only works to avoid duplicate downloads on
the same installation.

Also, note that we only have a cache of one single entry per dive
computer and downloader, so if you download dives and then don't save
the end result, the fingerprint will now point to a dive that you don't
actually have in your dive list.  As a result, next time you download,
the fingerprint won't match any existing dive, and we'll resort to the
old non-optimized behavior.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-24 17:54:08 -07:00
Linus Torvalds
acc343834a Actually tie in the new libdivecomputer IO model to open the dive computer device
This creates a new libdivecomputer_device_open() helper, and makes
downloading and configuration use it to open the dive computer device
using the proper protocol.

The IRDA case was tested by Sébastien Dugué - I had initially left it
undone believing that "nobody uses IRDA".

Reported-and-tested-by: Sébastien Dugué <sebastien.dugue.subsurface@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-24 17:54:08 -07:00
Linus Torvalds
13f5c75ac4 Convert our custom IO model to new libdivecomputer IO model
This converts our old custom IO model to the new model that
libdivecomputer introduced.  This is partly based on Jef's rough patch
to make things build, with further work by me.

The FTDI code is temporarily disabled here, because it will need to be
integrated with the new way of opening devices.

The ble_serial code goes away entirely, since now libdivecomputer knows
about BLE transport natively, and doesn't need to have any serial
wrapper around it.

Signed-off-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-04-24 17:54:08 -07:00
Dirk Hohndel
c07faa90f3 Travis: add building for iOS
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 15:47:49 -07:00
Dirk Hohndel
2137b21e1b iOS: allow building for the simulator & switch debug/release builds
It makes sense to be able to control this with command line options.
On Travis this avoids the signing problem and makes the build much faster.
Still should be enough to catch iOS breakage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 15:47:25 -07:00
Dirk Hohndel
c145911767 Travis: add iOS build
Disable most warnings for iOS test build as otherwise the Travis log file will
exceed 4MB and the build will fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 15:45:44 -07:00
Dirk Hohndel
2cba24fa1a iOS: don't show all the libgit2 warnings
We aren't concerned about the code quality of libgit2 and with these warnings
the build log overflows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-24 15:45:35 -07:00
jan Iversen
fdcc749c99 Updated with new round of comments.
Signed-off-by: Jan Iversen <jani@apache.org>
2018-04-24 15:38:15 +02:00
jan Iversen
953945f9f5 updated with review comments.
Signed-off-by: Jan Iversen <jani@apache.org>
2018-04-24 15:38:15 +02:00
jan iversen
4ac55611fc Incorporated review comments in INSTALL
updated INSTALL to reflect the review comments

Among others made homebrew / manual install equal choices as well
as Xcode / QtCreator.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-04-24 15:38:15 +02:00
jan Iversen
61f613cd6b Updated INSTALL, based on first time building experience.
INSTALL is updated to reflect how to install/build subusurface
on Mac. It has also been updated with several generic parts.

3 parts are still outstanding (to come soon):
QtWebKit, need to document how to download/build
Mac, final touches
iOS, need to document the build process

Signed-off-by: Jan Iversen <jani@apache.org>
2018-04-24 15:38:15 +02:00
Allen Hall
d4d99b0116 Add -libpath argument for qtmacdeploy
Resolves ERROR: no file at "/usr/lib/libgit2.dylib" when building on MacOS.

[Dirk Hohndel: SOB in PR #1201 - copying it into the commit for consistenty]

Signed-off-by: Allen Hall <revenant83@hotmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-23 09:31:11 -07:00
Dirk Hohndel
09edf25366 iOS: build Release by default
And add -debug option to build.sh for debug builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-23 09:28:41 -07:00
jan Iversen
50b8044d56 Updated doc. for handling of libdc
git.subsurface-divelog.org no longer exist.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-04-22 15:53:54 +02:00
Miika Turkia
4186733740 CSV import: fix setpoint (typo)
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-04-19 15:09:02 +03:00
Berthold Stoeger
529d407933 Cleanup: Make local function waitFor() of static linkage
Moreover, remove it from the `extern "C"` block, since extern/static
is oxymoronic.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-19 15:08:12 +03:00
Berthold Stoeger
8f4604ead8 Coding style: remove superfluous semicolons
Remove a semicolon after Q_OBJECT and a few others after the closing
braces of while loops.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-19 15:08:12 +03:00
Dirk Hohndel
d2d46d848a QML UI: fix incorrect icon references
Not sure why this has worked in the past - it was simply wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 18:57:08 -07:00
Dirk Hohndel
bb03bd862b QML UI: ensure delegate height is not a fraction
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:11:31 -07:00
Dirk Hohndel
c1bcba46f0 QML UI: dive list performance: enable caching
We had turned this off since it caused rendering issues, but that
appears to be fixed now - and it should help to get us smoother
rendering of the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:11:22 -07:00
Dirk Hohndel
95c9a505c6 QML UI: dive list performance: no background rectangle
This is one of the suggested performance enhancement to reduce redundant
painting.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 14:10:04 -07:00
Dirk Hohndel
2529529ff9 QML UI: make the code easier to read
And maybe this will make it faster as well? Depends on how the binding
is implemented, I guess.
But at least it's less confusing to read now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 09:40:14 -07:00
Dirk Hohndel
f8742a48b2 QML UI: show offline notice when going offline
The logic was backwards and showed the notice when the user switched to
auto sync mode.

Fixes #1204

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 08:12:56 -07:00
Dirk Hohndel
6b9a1f3850 QML UI: change auto cloud sync menu texts
This way the menu items describe what happens when you tap on that menu
item.  That seems more consistent and intuitive.

See #1204

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-16 08:08:24 -07:00
Dirk Hohndel
e10b252153 QML UI: suppress warnings when showing GPS fixes
Kirigami gets unhappy if a SwipeListItem isn't named listItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 18:27:02 -07:00
Dirk Hohndel
96611c630f Travis: make qt55 build report build failures correctly
The proxy for this is a check to see if the Subsurface binary was
created (in which case we assume that the build succeeded).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 16:05:50 -07:00
Dirk Hohndel
40755987ed Qt: don't use member function that requires Qt 5.8
This should have been caught by our build check, but it turns out that
that one isn't correctly reflected in its Travis status.

Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 14:46:56 -07:00
Dirk Hohndel
aba4b1d390 Update CHANGELOG
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 10:15:36 -07:00
Dirk Hohndel
dcc308e929 QML UI: recalculate derived information after editing dive
For example, when changing the cylinder, the SAC rate wasn't updated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 10:05:41 -07:00
Dirk Hohndel
24a798a5c3 QML UI: update to latest Kirigami
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 08:16:59 -07:00
Dirk Hohndel
026e90df3d QML UI: don't show a vertical scrollbar in dive list
With the folding trips it just looks confusing as it changes size.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 08:16:59 -07:00
Dirk Hohndel
a47bcbb3e7 QML: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15 08:16:59 -07:00
Dirk Hohndel
f28266bb19 iOS: fix info.plist
Xcode happily accepted the incorrect plist syntax for a boolean and the app
did the right thing when installed locally - but once you upload to the
iTunes store the error causes that to fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 21:05:49 -07:00
Dirk Hohndel
8508fa5be8 QML UI: always show dives that aren't in a trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 21:04:56 -07:00
Dirk Hohndel
cc319ad8b1 QML UI: allow collapsing the open trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14 20:32:40 -07:00