From 5e84cb09f8a2bffbdfe3743684d02e586dd00996 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Fri, 7 May 2021 00:22:51 +0200 Subject: [PATCH] Use dynamic app name for remote proxy connection --- libnymea-app/connection/awsclient.cpp | 2 +- libnymea-app/connection/cloudtransport.cpp | 3 ++- libnymea-app/connection/nymeaconnection.cpp | 1 + libnymea-app/thingmanager.cpp | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libnymea-app/connection/awsclient.cpp b/libnymea-app/connection/awsclient.cpp index 7f697dc7..f84a8419 100644 --- a/libnymea-app/connection/awsclient.cpp +++ b/libnymea-app/connection/awsclient.cpp @@ -948,7 +948,7 @@ bool AWSClient::postToMQTT(const QString &coreId, const QString &nonce, QObject* connect(reply, &QNetworkReply::finished, this, [reply, senderWatcher, callback]() { reply->deleteLater(); QByteArray data = reply->readAll(); -// qDebug() << "MQTT post reply" << data; + qCDebug(dcCloud()) << "MQTT post reply" << data; if (senderWatcher.isNull()) { qCDebug(dcCloud()) << "Request object disappeared. Discarding MQTT reply..."; return; diff --git a/libnymea-app/connection/cloudtransport.cpp b/libnymea-app/connection/cloudtransport.cpp index e7724481..59fb9eb5 100644 --- a/libnymea-app/connection/cloudtransport.cpp +++ b/libnymea-app/connection/cloudtransport.cpp @@ -36,6 +36,7 @@ #include #include #include +#include using namespace remoteproxyclient; @@ -43,7 +44,7 @@ CloudTransport::CloudTransport(AWSClient *awsClient, QObject *parent): NymeaTransportInterface(parent), m_awsClient(awsClient) { - m_remoteproxyConnection = new RemoteProxyConnection(QUuid::createUuid(), "nymea:app", this); + m_remoteproxyConnection = new RemoteProxyConnection(QUuid::createUuid(), qApp->applicationName(), this); QObject::connect(m_remoteproxyConnection, &RemoteProxyConnection::remoteConnectionEstablished, this,[this]() { qDebug() << "CloudTransport: Remote connection established."; diff --git a/libnymea-app/connection/nymeaconnection.cpp b/libnymea-app/connection/nymeaconnection.cpp index 2cb3181e..5f730295 100644 --- a/libnymea-app/connection/nymeaconnection.cpp +++ b/libnymea-app/connection/nymeaconnection.cpp @@ -289,6 +289,7 @@ void NymeaConnection::onConnected() void NymeaConnection::onDisconnected() { NymeaTransportInterface* t = qobject_cast(sender()); + qCInfo(dcNymeaConnection()) << "Disconnected from" << t->url().toString(); if (m_currentTransport != t) { qCDebug(dcNymeaConnection()) << "An inactive transport for url" << t->url() << "disconnected... Cleaning up..."; if (m_transportCandidates.contains(t)) { diff --git a/libnymea-app/thingmanager.cpp b/libnymea-app/thingmanager.cpp index 71e37c34..815c99b0 100644 --- a/libnymea-app/thingmanager.cpp +++ b/libnymea-app/thingmanager.cpp @@ -394,7 +394,7 @@ void ThingManager::editThingResponse(int commandId, const QVariantMap ¶ms) void ThingManager::executeActionResponse(int commandId, const QVariantMap ¶ms) { - qDebug() << "Execute Action response" << params; + qCDebug(dcThingManager()) << "Execute Action response" << params; emit executeActionReply(commandId, errorFromString(params.value("thingError").toByteArray()), params.value("displayMessage").toString()); } @@ -536,6 +536,7 @@ int ThingManager::executeAction(const QUuid &thingId, const QUuid &actionTypeId, p.insert("params", params); } + qCDebug(dcThingManager()) << "Executing action" << thingId << actionTypeId; return m_jsonClient->sendCommand("Integrations.ExecuteAction", p, this, "executeActionResponse"); }