From 87f130c55e2e60f16e9f281f5acbc1e08cd80452 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 8 Jul 2019 12:17:31 +0200 Subject: [PATCH 1/2] Fix an issue where the app might not reconnect to the core. --- libnymea-app-core/jsonrpc/jsonrpcclient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnymea-app-core/jsonrpc/jsonrpcclient.cpp b/libnymea-app-core/jsonrpc/jsonrpcclient.cpp index 3c2f677c..7fddca5a 100644 --- a/libnymea-app-core/jsonrpc/jsonrpcclient.cpp +++ b/libnymea-app-core/jsonrpc/jsonrpcclient.cpp @@ -322,6 +322,8 @@ void JsonRpcClient::onInterfaceConnectedChanged(bool connected) } } else { qDebug() << "JsonRpcClient: Transport connected. Starting handshake."; + // Clear anything that might be left in the buffer from a previous connection. + m_receiveBuffer.clear(); QVariantMap params; params.insert("locale", QLocale().name()); sendCommand("JSONRPC.Hello", params, this, "helloReply"); From f852b8b71d5928f6482fcac8cfd67be266aab446 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 8 Jul 2019 12:24:25 +0200 Subject: [PATCH 2/2] Add some debug prints to debug more issues --- libnymea-app-core/connection/nymeaconnection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libnymea-app-core/connection/nymeaconnection.cpp b/libnymea-app-core/connection/nymeaconnection.cpp index f8f251b5..abcf5f4e 100644 --- a/libnymea-app-core/connection/nymeaconnection.cpp +++ b/libnymea-app-core/connection/nymeaconnection.cpp @@ -406,6 +406,15 @@ void NymeaConnection::updateActiveBearers() foreach (const QNetworkConfiguration &config, configs) { qDebug() << "Inactive network config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName(); } + + // Retrying with a new config manager: + QNetworkConfigurationManager *newMan = new QNetworkConfigurationManager(this); + qDebug() << "Trying with new config manager:"; + configs = newMan->allConfigurations(); + foreach (const QNetworkConfiguration &config, configs) { + qDebug() << "Config:" << config.name() << config.bearerTypeFamily() << config.bearerTypeName() << config.state(); + } + newMan->deleteLater(); } if (m_availableBearerTypes != availableBearerTypes) {