example 'meshtastic': fix possible BLE crash

This commit is contained in:
pls.153 2024-06-03 17:47:40 +02:00
parent 29356f5142
commit 21e46841ef

View file

@ -136,12 +136,14 @@ void BLE::addLowEnergyService(const QBluetoothUuid& serviceUuid) {
} }
void BLE::serviceScanDone() { void BLE::serviceScanDone() {
scanned = true; if (mainService != nullptr) {
Q_EMIT mainServiceReady(); scanned = true;
qDebug() << "service scan done"; Q_EMIT mainServiceReady();
qDebug() << "service scan done";
#if QT_VERSION >= 0x060000 #if QT_VERSION >= 0x060000
qDebug() << "MTU:" << controller->mtu(); qDebug() << "MTU:" << controller->mtu();
#endif #endif
}
} }
void BLE::connectToService(const QString& uuid) { void BLE::connectToService(const QString& uuid) {