Use dynamic app name for remote proxy connection

pull/592/head
Michael Zanetti 2021-05-07 00:22:51 +02:00
parent d96571a5a9
commit 5e84cb09f8
4 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -36,6 +36,7 @@
#include <QUrlQuery>
#include <QHostInfo>
#include <QPointer>
#include <QCoreApplication>
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.";

View File

@ -289,6 +289,7 @@ void NymeaConnection::onConnected()
void NymeaConnection::onDisconnected()
{
NymeaTransportInterface* t = qobject_cast<NymeaTransportInterface*>(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)) {

View File

@ -394,7 +394,7 @@ void ThingManager::editThingResponse(int commandId, const QVariantMap &params)
void ThingManager::executeActionResponse(int commandId, const QVariantMap &params)
{
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");
}