Skip to content

Commit

Permalink
HR monitor connection issues with latest beta #751
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Mar 31, 2022
1 parent ce7ad4a commit f626227
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
31 changes: 15 additions & 16 deletions src/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1512,24 +1512,23 @@ void bluetooth::connectedAndDiscovered() {
if (this->device() != nullptr) {

#ifdef Q_OS_IOS
// this will leading to unreliable connection to HR
#if 0
QString heartRateBeltName = settings.value("heart_rate_belt_name", "Disabled").toString();
QString b = settings.value("hrm_lastdevice_name", "").toString();
qDebug() << "last hrm name" << b;
if (!b.compare(heartRateBeltName) && b.length()) {

heartRateBelt = new heartratebelt();
// connect(heartRateBelt, SIGNAL(disconnected()), this, SLOT(restart()));
if(settings.value(QStringLiteral("ios_cache_heart_device"), true).toBool()) {
QString heartRateBeltName = settings.value("heart_rate_belt_name", "Disabled").toString();
QString b = settings.value("hrm_lastdevice_name", "").toString();
qDebug() << "last hrm name" << b;
if (!b.compare(heartRateBeltName) && b.length()) {

connect(heartRateBelt, SIGNAL(debug(QString)), this, SLOT(debug(QString)));
connect(heartRateBelt, SIGNAL(heartRate(uint8_t)), this->device(), SLOT(heartRate(uint8_t)));
QBluetoothDeviceInfo bt;
bt.setDeviceUuid(QBluetoothUuid(settings.value("hrm_lastdevice_address", "").toString()));
qDebug() << "UUID" << bt.deviceUuid();
heartRateBelt->deviceDiscovered(bt);
heartRateBelt = new heartratebelt();
// connect(heartRateBelt, SIGNAL(disconnected()), this, SLOT(restart()));

connect(heartRateBelt, SIGNAL(debug(QString)), this, SLOT(debug(QString)));
connect(heartRateBelt, SIGNAL(heartRate(uint8_t)), this->device(), SLOT(heartRate(uint8_t)));
QBluetoothDeviceInfo bt;
bt.setDeviceUuid(QBluetoothUuid(settings.value("hrm_lastdevice_address", "").toString()));
qDebug() << "UUID" << bt.deviceUuid();
heartRateBelt->deviceDiscovered(bt);
}
}
#endif
#endif
for (const QBluetoothDeviceInfo &b : qAsConst(devices)) {
if (((b.name().startsWith(heartRateBeltName))) && !heartRateBelt &&
Expand Down
2 changes: 1 addition & 1 deletion src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ ApplicationWindow {
}
}
ItemDelegate {
text: "version 2.10.55"
text: "version 2.10.56"
width: parent.width
}
FileDialog {
Expand Down
2 changes: 1 addition & 1 deletion src/qdomyos-zwift.pro
Original file line number Diff line number Diff line change
Expand Up @@ -658,5 +658,5 @@ ios {
DEFINES+=_Nullable_result=_Nullable NS_FORMAT_ARGUMENT\\(A\\)=
}

VERSION = 2.10.55
VERSION = 2.10.56

18 changes: 18 additions & 0 deletions src/settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ import Qt.labs.settings 1.0
// from the version 2.10.49
property bool dircon_yes: false
property int dircon_server_base_port: 4810

// from the version 2.10.56
property bool ios_cache_heart_device: true
}

function paddingZeros(text, limit) {
Expand Down Expand Up @@ -5940,6 +5943,21 @@ import Qt.labs.settings 1.0
onClicked: settings.applewatch_fakedevice = checked
}

SwitchDelegate {
id: appleHeartCacheDelegate
text: qsTr("iOS Heart Caching")
spacing: 0
bottomPadding: 0
topPadding: 0
rightPadding: 0
leftPadding: 0
clip: false
checked: settings.ios_cache_heart_device
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
onClicked: settings.ios_cache_heart_device = checked
}

SwitchDelegate {
id: logDebugDelegate
text: qsTr("Debug Log")
Expand Down

0 comments on commit f626227

Please sign in to comment.