Index: cppcheck.err =================================================================== diff -u -r54aae98b72e3804008acad0bbbb7573be8e35707 -rfaa306f41ddc70a48d042cc265396ef32116ad97 --- cppcheck.err (.../cppcheck.err) (revision 54aae98b72e3804008acad0bbbb7573be8e35707) +++ cppcheck.err (.../cppcheck.err) (revision faa306f41ddc70a48d042cc265396ef32116ad97) @@ -48,13 +48,13 @@ [sources/view/VTreatmentCreate.cpp:439]: (style) The function 'doFinishedConfirm' is never used. [sources/view/VTreatmentCreate.cpp:196]: (style) The function 'doFinishedCreate' is never used. [sources/view/VTreatmentCreate.cpp:576]: (style) The function 'doFinishedPrime' is never used. -[sources/view/VBluetooth.cpp:115]: (style) The function 'doGetDevices' is never used. +[sources/view/VBluetooth.cpp:121]: (style) The function 'doGetDevices' is never used. [sources/view/VTreatmentCreate.cpp:818]: (style) The function 'doGetOperatingParameterNames' is never used. [sources/view/VTreatmentCreate.cpp:837]: (style) The function 'doGetOperatingParameterValues' is never used. -[sources/view/VBluetooth.cpp:125]: (style) The function 'doGetPairedDevices' is never used. +[sources/view/VBluetooth.cpp:131]: (style) The function 'doGetPairedDevices' is never used. [sources/view/VTreatmentCreate.cpp:785]: (style) The function 'doGetPrescriptionParameterNames' is never used. [sources/view/VTreatmentCreate.cpp:802]: (style) The function 'doGetPrescriptionParameterValues' is never used. -[sources/view/VVitals.cpp:55]: (style) The function 'doManualBPMeasureEntry' is never used. +[sources/view/VVitals.cpp:69]: (style) The function 'doManualBPMeasureEntry' is never used. [sources/view/VEventSpy.cpp:139]: (style) The function 'doMouseReset' is never used. [sources/view/hd/adjustment/VTreatmentAdjustmentUltrafiltrationConfirm.cpp:66]: (style) The function 'doOptionDuration' is never used. [sources/view/VTreatmentCreate.cpp:905]: (style) The function 'doRequestPop' is never used. @@ -64,7 +64,7 @@ [sources/view/hd/alarm/VAlarmStatus.cpp:76]: (style) The function 'doSilence' is never used. [sources/view/VTreatmentBegin.cpp:72]: (style) The function 'doStartTreatment' is never used. [sources/view/VEventSpy.cpp:182]: (style) The function 'doTouchReset' is never used. -[sources/view/VVitals.cpp:42]: (style) The function 'doUpdateBPMeasureInterval' is never used. +[sources/view/VVitals.cpp:56]: (style) The function 'doUpdateBPMeasureInterval' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:55]: (style) The function 'doUserActionEnd' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:65]: (style) The function 'doUserActionOk' is never used. [sources/view/hd/alarm/VAlarmStatus.cpp:35]: (style) The function 'doUserActionResume' is never used. Index: scripts/run.sh =================================================================== diff -u -r757a01c42a7a611704a67869a74c68f53edab20f -rfaa306f41ddc70a48d042cc265396ef32116ad97 --- scripts/run.sh (.../run.sh) (revision 757a01c42a7a611704a67869a74c68f53edab20f) +++ scripts/run.sh (.../run.sh) (revision faa306f41ddc70a48d042cc265396ef32116ad97) @@ -72,6 +72,7 @@ # setup bluetooth mkdir -p "$HOME/settings" +# Wait for drivers to initialize. TODO: Investigate what is needed to reduce/remove this sleep 5 killall connmand /usr/share/silex-uart/silex-uart.sh start Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r510ea07f96362a18f9961f41b5b91740df075c1f -rfaa306f41ddc70a48d042cc265396ef32116ad97 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 510ea07f96362a18f9961f41b5b91740df075c1f) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision faa306f41ddc70a48d042cc265396ef32116ad97) @@ -113,6 +113,9 @@ readonly property int notificationBarIconHeight : 30 readonly property int notificationBarIconWidth : 30 + readonly property int settingsArrowHeight : 30 + readonly property int settingsArrowWidth : 24 + readonly property int settingsBLEListViewWidth : 360 readonly property int settingsBLEItemRightMargin : 20 readonly property int settingsBLEButtonWidth : 300 Index: sources/view/VBluetooth.cpp =================================================================== diff -u -rd00fa04f905b2abdac357a850d737a5f9d5e38df -rfaa306f41ddc70a48d042cc265396ef32116ad97 --- sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision d00fa04f905b2abdac357a850d737a5f9d5e38df) +++ sources/view/VBluetooth.cpp (.../VBluetooth.cpp) (revision faa306f41ddc70a48d042cc265396ef32116ad97) @@ -42,8 +42,8 @@ this, SLOT(onDisconnectedFromDevice(QBluetoothDeviceInfo))); // outgoing - connect(this, SIGNAL(didSelectDevice(const QString)), - &_BLEScanner, SLOT(doSelectDevice(const QString))); + connect(this, SIGNAL(didSelectDevice(const QString, const QString)), + &_BLEScanner, SLOT(doSelectDevice(const QString, const QString))); connect(this, SIGNAL(didRequestScanForDevices()), &_BLEScanner, SLOT(doScanForDevices())); @@ -137,18 +137,20 @@ * \brief VBluetooth::onSelectedDevice * Emits a signal that the device was selected * \param addr - the selected BLE mac address + * \param name - the selected BLE device name */ -void VBluetooth::doSelectDevice(const QString &addr) +void VBluetooth::doSelectDevice(const QString &addr, const QString &name) { - for (QObject *device : _unpairedDevices) { - VBluetoothDeviceInfo *d = static_cast(device); - if (addr == d->getAddress()) - { - delete _lastSelectedDevice; - _lastSelectedDevice = new VBluetoothDeviceInfo(addr, d->getName()); - emit didSelectDevice(addr); - } + if (_lastSelectedDevice != nullptr && _lastSelectedDevice->getAddress() != addr) + { + QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo(QBluetoothAddress(addr), name, + QBluetoothDeviceInfo::HealthBloodPressureMonitor); + onDisconnectedFromDevice(deviceInfo); } + + delete _lastSelectedDevice; + _lastSelectedDevice = new VBluetoothDeviceInfo(addr, name); + emit didSelectDevice(addr, name); } /*! Index: sources/view/VBluetooth.h =================================================================== diff -u -ra47e7059c91c50cee3e05972fe5d96c053cdfb31 -rfaa306f41ddc70a48d042cc265396ef32116ad97 --- sources/view/VBluetooth.h (.../VBluetooth.h) (revision a47e7059c91c50cee3e05972fe5d96c053cdfb31) +++ sources/view/VBluetooth.h (.../VBluetooth.h) (revision faa306f41ddc70a48d042cc265396ef32116ad97) @@ -41,12 +41,12 @@ void doScanForDevices(); QVariant doGetDevices(); QVariant doGetPairedDevices(); - void doSelectDevice(const QString &addr); + void doSelectDevice(const QString &addr, const QString &name); void doSaveMyDevices(const QString &path = Bluetooth_Saved_Devices_Path_JSON); signals: void didDevicesChanged(); - void didSelectDevice(const QString &addr); + void didSelectDevice(const QString &addr, const QString &name); void didScanFinished(); void didStatusChanged(); void didRequestScanForDevices();