AWS disconnect fixes
This commit is contained in:
parent
46a61e3ccc
commit
f563be8d40
@ -187,6 +187,10 @@ void AWSConnector::disconnectAWS()
|
|||||||
m_shouldReconnect = false;
|
m_shouldReconnect = false;
|
||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
m_client->Disconnect(std::chrono::seconds(2));
|
m_client->Disconnect(std::chrono::seconds(2));
|
||||||
|
m_client.reset();
|
||||||
|
m_networkConnection.reset();
|
||||||
|
qCDebug(dcAWS()) << "Disconnected from AWS.";
|
||||||
|
emit disconnected();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -206,12 +206,18 @@ ConfigurationHandler::ConfigurationHandler(QObject *parent):
|
|||||||
params.insert("language", JsonTypes::basicTypeToString(JsonTypes::String));
|
params.insert("language", JsonTypes::basicTypeToString(JsonTypes::String));
|
||||||
setParams("LanguageChanged", params);
|
setParams("LanguageChanged", params);
|
||||||
|
|
||||||
|
params.clear(); returns.clear();
|
||||||
|
setDescription("CloudConfigurationChanged", "Emitted whenever the cloud configuration is changed.");
|
||||||
|
params.insert("enabled", JsonTypes::basicTypeToString(JsonTypes::Bool));
|
||||||
|
setParams("CloudConfigurationChanged", params);
|
||||||
|
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::serverNameChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::serverNameChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::timeZoneChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::timeZoneChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::localeChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::localeChanged, this, &ConfigurationHandler::onBasicConfigurationChanged);
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::tcpServerConfigurationChanged, this, &ConfigurationHandler::onTcpServerConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::tcpServerConfigurationChanged, this, &ConfigurationHandler::onTcpServerConfigurationChanged);
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::webServerConfigurationChanged, this, &ConfigurationHandler::onWebServerConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::webServerConfigurationChanged, this, &ConfigurationHandler::onWebServerConfigurationChanged);
|
||||||
connect(GuhCore::instance()->configuration(), &GuhConfiguration::webSocketServerConfigurationChanged, this, &ConfigurationHandler::onWebSocketServerConfigurationChanged);
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::webSocketServerConfigurationChanged, this, &ConfigurationHandler::onWebSocketServerConfigurationChanged);
|
||||||
|
connect(GuhCore::instance()->configuration(), &GuhConfiguration::cloudEnabledChanged, this, &ConfigurationHandler::onCloudConfigurationChanged);
|
||||||
connect(GuhCore::instance()->deviceManager(), &DeviceManager::languageUpdated, this, &ConfigurationHandler::onLanguageChanged);
|
connect(GuhCore::instance()->deviceManager(), &DeviceManager::languageUpdated, this, &ConfigurationHandler::onLanguageChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,6 +448,16 @@ void ConfigurationHandler::onWebSocketServerConfigurationChanged(const QString &
|
|||||||
emit WebSocketServerConfigurationChanged(params);
|
emit WebSocketServerConfigurationChanged(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigurationHandler::onCloudConfigurationChanged(bool enabled)
|
||||||
|
{
|
||||||
|
QVariantMap params;
|
||||||
|
qCDebug(dcJanus()) << "Notification: cloud configuration changed";
|
||||||
|
QVariantMap cloudConfiguration;
|
||||||
|
cloudConfiguration.insert("enabled", enabled);
|
||||||
|
params.insert("cloudConfiguration", cloudConfiguration);
|
||||||
|
emit CloudConfigurationChanged(params);
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigurationHandler::onLanguageChanged()
|
void ConfigurationHandler::onLanguageChanged()
|
||||||
{
|
{
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
|
|||||||
@ -54,6 +54,7 @@ signals:
|
|||||||
void TcpServerConfigurationChanged(const QVariantMap ¶ms);
|
void TcpServerConfigurationChanged(const QVariantMap ¶ms);
|
||||||
void WebServerConfigurationChanged(const QVariantMap ¶ms);
|
void WebServerConfigurationChanged(const QVariantMap ¶ms);
|
||||||
void WebSocketServerConfigurationChanged(const QVariantMap ¶ms);
|
void WebSocketServerConfigurationChanged(const QVariantMap ¶ms);
|
||||||
|
void CloudConfigurationChanged(const QVariantMap ¶ms);
|
||||||
void LanguageChanged(const QVariantMap ¶ms);
|
void LanguageChanged(const QVariantMap ¶ms);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -61,6 +62,7 @@ private slots:
|
|||||||
void onTcpServerConfigurationChanged(const QString &id);
|
void onTcpServerConfigurationChanged(const QString &id);
|
||||||
void onWebServerConfigurationChanged(const QString &id);
|
void onWebServerConfigurationChanged(const QString &id);
|
||||||
void onWebSocketServerConfigurationChanged(const QString &id);
|
void onWebSocketServerConfigurationChanged(const QString &id);
|
||||||
|
void onCloudConfigurationChanged(bool enabled);
|
||||||
void onLanguageChanged();
|
void onLanguageChanged();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
7
tests/scripts/setcloudenabled.sh
Executable file
7
tests/scripts/setcloudenabled.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$2" == "" ]; then
|
||||||
|
echo "usage: $0 host <true|false>"
|
||||||
|
else
|
||||||
|
(echo '{"id":1, "method":"Configuration.SetCloudEnabled", "params":{"enabled": "'$2'"}}'; sleep 10) | nc $1 2222
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user