diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/qt-ble.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/qt-ble.cpp b/core/qt-ble.cpp index 6ddc1a9b8..4fc2cd5df 100644 --- a/core/qt-ble.cpp +++ b/core/qt-ble.cpp @@ -100,10 +100,6 @@ void BLEObject::addService(const QBluetoothUuid &newService) qDebug() << " .. created service object" << service; if (service) { services.append(service); - connect(service, &QLowEnergyService::stateChanged, this, &BLEObject::serviceStateChanged); - connect(service, &QLowEnergyService::characteristicChanged, this, &BLEObject::characteristcStateChanged); - connect(service, &QLowEnergyService::characteristicWritten, this, &BLEObject::characteristicWritten); - connect(service, &QLowEnergyService::descriptorWritten, this, &BLEObject::writeCompleted); service->discoverDetails(); } } @@ -285,6 +281,11 @@ dc_status_t BLEObject::select_preferred_service(void) return DC_STATUS_IO; } + connect(preferred, &QLowEnergyService::stateChanged, this, &BLEObject::serviceStateChanged); + connect(preferred, &QLowEnergyService::characteristicChanged, this, &BLEObject::characteristcStateChanged); + connect(preferred, &QLowEnergyService::characteristicWritten, this, &BLEObject::characteristicWritten); + connect(preferred, &QLowEnergyService::descriptorWritten, this, &BLEObject::writeCompleted); + return DC_STATUS_SUCCESS; } |