Most writes to a connected DC are small, typically some
command bytes to get DC in download mode, or to set
some parameter. All this just worked over BLE,
however, sending a full firmware update (on an
OSTC device) failed, as the underlying BLE interface
can only handle small 20 byte BLE packets at once.
So, send max ble->packet_size chuncks at once.
Tested for the following cases (linux desktop with
OSTC3 over BLE):
1) normal download of dive data.
2) read and write settings from configure UI
3) update firmware (from 2.15 to 2.15)
And to my surprise, no flow control credit administration
is required here.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Stupidly, commit 731d9dc9bd ("DC download: tell user when no new dives
were found") was missing the conditional when to show that messages.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a manually created single commit to incorporate the changes in
https://github.com/Subsurface-divelog/subsurface/pull/502Closes#502
[Dirk Hohndel:]
I was able to manually merge that branch but it created a complete mess
out of the tree and brought several dozen commits in a second time, so
I gave up and instead created this single commit.
Signed-off-by: Philippe Massart <philippe@philmassart.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This option should have never been there. This is not how
gradient factors are supposed to work. It would only trick
users to use the wrong value..
Signed-off-by: Robert C. Helling <helling@atdotde.de>
MapWidgetHelper::calculateSmallCircleRadius() uses
the second argument (boolean) of QDeclarativeGeoMap::toCoordinate()
and QDeclarativeGeoMap::fromCoordinate(), which isn't supported
in Qt 5.5.x and errors will be thrown on runtime.
This argument usage is redundant for the calculateSmallCircleRadius()
use case.
If the argument is set to "false" it tells the map to avoid
clipping the viewport and always return a valid QPointF/QGeoCoordinate.
Given that calculateSmallCircleRadius() only works with the
map center - i.e it's called like so in MapWidget.qml:
onZoomLevelChanged: mapHelper.calculateSmallCircleRadius(map.center)
The only way for the radius estimation to fail is if the map widget
width is smaller than SMALL_CIRCLE_RADIUS_PX * 2 = 52px, which is not
possible as the MainWindow splitter prevents it.
If the map widget becomes that small it would be hardly usable,
yet no errors should be thrown related to this change.
Tested-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
While this interface is deprecated, too much in our existing code depends
on being able to create the QLowEnergyController with just the address.
Additionally, createCentral() is new in Qt 5.7 and therefor this broke
builds on Linux distros that are still on 5.6.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For some reason the progress bar on macOS doesn't show the
progress text. This creates a label below the progress bar
and shows the text there instead.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Especially on BT/BLE devices, where there is a longer negotiation
phase at the beginning of the download, this seems more user friendly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The ordering on Mac appears to be random, but after looking through the
various successful logs of BLE downloads, it seems we always wrote to the
ClientCharacteristicConfiguration descriptor. So try to find that one first,
and only grab the first descriptor in the list if we didn't find a
ClientCharacteristicConfiguration descriptor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now this will only work if you scan for your BLE dive computer every
time. Ideally we should simply initiate a scan and look for that address if
it's not found in the hash.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Following on beb0d5703a, the context menu seems to work fine
with a much older QtQuick import - version 2.0.
The 2.7 import is technically a development leftover
and a minimal version should have been considered earlier.
On older Qt setups (e.g. 5.5.x) this might throw a:
'module "QtQuick" version 2.6 is not installed'
Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Go back to the old startegy of retrieving the correct end of the dive
plot by looking at the plot data instead of looking at dc->duration.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Meanwhile (after removing marble) it seems to be a good choice to use
latest MXE version with currently Qt 5.9.1.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Dive IDs are unique but same dive number can appear multiple times within
the same database. This can happen for example when user changes the
"next log number" from his computer.
Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
The provided strod_flags(str, 0, 0) should work as a drop in replacement
for atof() but does not care about locales which may cause atof() to fail.
strtod_flags() would allow checking of conversion result, but I did not
change the existing logic. This was just regexp search&replace change
to get rid of atof(). I use flags 0 to get more relaxed conversion.
Fixes#574
Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
We only cleared the first sensor data when we created new synthetic plot
info entries, because we only used to have one (well, we had the o2
data, but apparently nobody ever noticed that it didn't get properly
interpolated, probably because people who have CCR dives with o2
pressures are few, and the pressure drops are gradual anyway).
Clear all the pressure data, so that the interpolation code doesn't
think we have some existing real sensor data for the plot info entries
in between proper sample entries.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The XML saving code got the multi-sensor case completely wrong, because
it still had one place where it would always save the first pressure,
rather than the pressure from the right sensor.
This was hidden by the fact that old data would be saved using the
legacy model that only ever used the first sensor slot. Only if you
actually had multiple sensor slots used would the bug trigger.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Consider cylinder used also if the first and last sample pressure differ
enough
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When Linus modified the gas handling code six weeks ago he pointed out
that that had broken the tankbar; with this patch we now simply walk the
gas changes of the displayed dive directly and create the tankbar
rectangles from that information.
See #562
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We used to only show the first pressure we had, from back when we only
supported a single sensor.
Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Re-do the logic to use add_gas_switch_event() instead of creating event
manually.
Fix the SQL query to find the proper dive id from dive log number.
Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
As these are probably manually entered dives with incomplete data, it is
better not to merge them.
See #561
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>