Skip to content
Permalink
Browse files

Changed timeout settings

Pull request review feedback: changed timeoutMs to timeout
  • Loading branch information
zehnm committed Dec 21, 2019
1 parent bf66aee commit 8915f4091730a0783f2666ace08b17c4c2513c51
@@ -2,7 +2,7 @@
"systemservice": {
"systemd": {
"sudo" : false,
"timeoutMs" : 30000,
"timeout" : 30000,
"services": {
"wifi": "wpa_supplicant@wlan0.service",
"dns": "systemd-resolved.service",
@@ -19,8 +19,8 @@
"wifi": {
"maxScanResults": 20,
"joinRetryCount": 5,
"joinRetryDelayMs": 3000,
"pollIntervalMs": 20000,
"joinRetryDelay": 3000,
"pollInterval": 20000,
"useShellScript": false,
"interface": {
"wpa_supplicant" : {
@@ -112,7 +112,7 @@ HardwareFactoryRPi0::HardwareFactoryRPi0(const QVariantMap &config, QObject *par
p_wifiControl->setMaxScanResults(wifiCfg.value(HW_CFG_WIFI_SCAN_RESULTS, HW_DEF_WIFI_SCAN_RESULTS).toInt());
p_wifiControl->setPollInterval(wifiCfg.value(HW_CFG_WIFI_POLL_INTERVAL, HW_DEF_WIFI_POLL_INTERVAL).toInt());
p_wifiControl->setNetworkJoinRetryCount(wifiCfg.value(HW_CFG_WIFI_JOIN_RETRY, HW_DEF_WIFI_JOIN_RETRY).toInt());
p_wifiControl->setNetworkJoinRetryDelayMs(wifiCfg.value(HW_CFG_WIFI_JOIN_DELAY, HW_DEF_WIFI_JOIN_DELAY).toInt());
p_wifiControl->setNetworkJoinRetryDelay(wifiCfg.value(HW_CFG_WIFI_JOIN_DELAY, HW_DEF_WIFI_JOIN_DELAY).toInt());
}

WifiControl *HardwareFactoryRPi0::getWifiControl()
@@ -32,7 +32,7 @@
#define HW_CFG_SYSTEMD_SUDO "sudo"
#define HW_DEF_SYSTEMD_SUDO false

#define HW_CFG_SYSTEMD_TIMEOUT "timeoutMs"
#define HW_CFG_SYSTEMD_TIMEOUT "timeout"
#define HW_DEF_SYSTEMD_TIMEOUT 30000

#define HW_CFG_SERVICE_WIFI "wifi"
@@ -60,9 +60,9 @@
#define HW_DEF_WIFI_SCAN_RESULTS 50
#define HW_CFG_WIFI_JOIN_RETRY "joinRetryCount"
#define HW_DEF_WIFI_JOIN_RETRY 5
#define HW_CFG_WIFI_JOIN_DELAY "joinRetryDelayMs"
#define HW_CFG_WIFI_JOIN_DELAY "joinRetryDelay"
#define HW_DEF_WIFI_JOIN_DELAY 3000
#define HW_CFG_WIFI_POLL_INTERVAL "pollIntervalMs"
#define HW_CFG_WIFI_POLL_INTERVAL "pollInterval"
#define HW_DEF_WIFI_POLL_INTERVAL 10000
#define HW_CFG_WIFI_USE_SH "useShellScript"
#define HW_DEF_WIFI_USE_SH false
@@ -33,7 +33,7 @@ WifiControl::WifiControl(QObject* parent)
, m_maxScanResults(HW_DEF_WIFI_SCAN_RESULTS)
, m_pollInterval(HW_DEF_WIFI_POLL_INTERVAL)
, m_networkJoinRetryCount(HW_DEF_WIFI_JOIN_RETRY)
, m_networkJoinRetryDelayMs(HW_DEF_WIFI_JOIN_DELAY)
, m_networkJoinRetryDelay(HW_DEF_WIFI_JOIN_DELAY)
{
qCDebug(CLASS_LC) << Q_FUNC_INFO;
}
@@ -154,14 +154,14 @@ void WifiControl::setMaxScanResults(int number)
m_maxScanResults = number;
}

int WifiControl::getNetworkJoinRetryDelayMs() const
int WifiControl::getNetworkJoinRetryDelay() const
{
return m_networkJoinRetryDelayMs;
return m_networkJoinRetryDelay;
}

void WifiControl::setNetworkJoinRetryDelayMs(int msDelay)
void WifiControl::setNetworkJoinRetryDelay(int msDelay)
{
m_networkJoinRetryDelayMs = msDelay;
m_networkJoinRetryDelay = msDelay;
}

int WifiControl::getNetworkJoinRetryCount() const
@@ -139,8 +139,8 @@ class WifiControl : public QObject
int getNetworkJoinRetryCount() const;
void setNetworkJoinRetryCount(int count);

int getNetworkJoinRetryDelayMs() const;
void setNetworkJoinRetryDelayMs(int msDelay);
int getNetworkJoinRetryDelay() const;
void setNetworkJoinRetryDelay(int msDelay);

signals:
// TODO do we need individual signals or simply use wifiStatusChanged?
@@ -243,7 +243,7 @@ public slots:
int m_pollInterval;
int m_timerId;
int m_networkJoinRetryCount;
int m_networkJoinRetryDelayMs;
int m_networkJoinRetryDelay;

};

@@ -300,7 +300,7 @@ bool WifiWpaSupplicant::join(const QString &ssid, const QString &password, WifiS
return saveConfiguration(resetIfFailed);
}

QThread::currentThread()->msleep(getNetworkJoinRetryDelayMs());
QThread::currentThread()->msleep(getNetworkJoinRetryDelay());
}

qCWarning(CLASS_LC) << "Failed to establish connection to AP" << ssid << "after" << getNetworkJoinRetryCount() << "retries";

0 comments on commit 8915f40

Please sign in to comment.
You can’t perform that action at this time.