aboutsummaryrefslogtreecommitdiffstats
path: root/core/btdiscovery.h
AgeCommit message (Collapse)Author
2018-02-26Cleanup: Use QString as parameter for [get|save]BtDeviceInfo()Gravatar Berthold Stoeger
Each callsite of saveBtDeviceInfo() has a QString, which is converted to a C-string, passed and immediately converted back. Remove these conversions by taking a reference to QString directly. getBtDeviceInfo() is not as clear. Here, the callsite has a C-string handed down from libdivecomputer. Nevertheless, pass a reference of QString here as well. Firstly, for reasons of symmetry. Secondly, to avoid multiple conversions in the getBtDeviceInfo() functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-12mobile: enable switching BT on/off during session.Gravatar Jan Mulder
This commit implements possible switching BT on and off during a session, so not needing a restart of the app when the user forgot to switch it on when starting the app. For this, the following needed to be done: 1) create a handler that reacts on local BT device status changes. 2) repopulate the connection list in the download screen when a BT status change is detected. Notice the subtile change of the Q_INVOKABLE btEnabled() function to a Q_PROPERTY. This gives a nice dynamic behaviour when switching BT on/off with the app open. Fixes: #556 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-07Make compile succeed without BT_SUPPORTGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07Move ConnectionListModel into its own source fileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17BLE: helper function to get QBtDeviceInfo from UUIDGravatar Dirk Hohndel
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>
2017-07-16Add ConnectionListModelGravatar Dirk Hohndel
We'll use that to do a better job of showing the connection used when talking to a dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-12BT support: track if Bluetooth is availableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03Rewrite the matching code for BT devicesGravatar Dirk Hohndel
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-06-30QML UI: save BT address as stringGravatar Dirk Hohndel
And do the same LE: prefix marking as in the desktop version. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12Don't declare static function in .h fileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12Mobile: wrap up fixes for BT download on AndroidGravatar Jan Mulder
Major functional change in this commit is the addition of found static BT devices to the internal administration (on Android), in a way that is equivalent to mobile-on-desktop. So, in both cases, the list of devices in the app are as in the list of devices on the host OS (Linux or Android). To minimize code duplication, the btDeviceDiscovered slot is split in two parts, the part to act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and the part only needed for Android. Remaining to be fixed: the correct handling of the QML UI selection of vendor/product. The first default dive computer is correctly detected, all paired devices from the virtual vendow can be selected, but clicking through vendors results in non logical selections. It is obvious why this is, but a fix is not straigforward at this point. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12Mobile: add BT name to vendor/product capabilityGravatar Jan Mulder
This adds a central function to convert a BT name to a vendor/product pair known to Subsurface. This allows interfacing from a paired BT dive computer, without actively selecting its type, but by selecting it from the list of paired BT devices. So, after this, downloading from multiple (paired) DCs is also possible. And not the niced piece of code ... Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12QML UI: add internal admin for virtual vendorGravatar Jan Mulder
Added a list of paired BT devices for the "Paired BT Devices" vendor. The devices under this vendor represent all BT devces that can be found from the local BT interface. Some special processing is required, as the BT provided data is (obviously) missing the specific data needed to open a BT device using libdc code. This processing is not in this commit, but will follow. This commit is preparation for that. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11Android build fixGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11QML UI: move BT handling into core codeGravatar Dirk Hohndel
This shouldn't be part of the UI (qmlmanager), but part of our overall handling of dive computers and BT devices. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>