Index: sources/wifi/WifiInterface.h =================================================================== diff -u -r5600d2133dd0ea6dc1f733aa78bd26e2a4892a38 -r2085962f7bd0a2239ee5c857928a11d5e38fe0a2 --- sources/wifi/WifiInterface.h (.../WifiInterface.h) (revision 5600d2133dd0ea6dc1f733aa78bd26e2a4892a38) +++ sources/wifi/WifiInterface.h (.../WifiInterface.h) (revision 2085962f7bd0a2239ee5c857928a11d5e38fe0a2) @@ -26,8 +26,12 @@ QThread *_thread = nullptr; bool _init = false; bool _scanRunning = false; - QProcess _scanProcess; - QProcess _wifiInterfaceProcess; + int _defaultTimeout = 5000; + int _dhcpTimeout = 10000; + QProcess _processScan; + QProcess _processJoinNetwork; + QProcess _processGetIPAddress; + Network _network; const QString _iface = "wlan0"; const QString _wpaSupplicantConfPath = "/etc/wpa_supplicant.conf"; @@ -37,6 +41,17 @@ SINGLETON(WifiInterface) private: + bool generateWPASupplicant(const Network &vNetwork, const QString &vPassword); + bool startWPASupplicant(); + bool requestAutoAssignedIP(); + QString readIPSettings(); + QString readGateway(); + QString readDNS(); + QString parseIP(const QString &vOutput); + QString parseBroadcast(const QString &vOutput); + QString parseSubnetMask(const QString &vOutput); + QString parseGateway(const QString &vOutput); + QString parseDNS(const QString &vOutput); void onInitConnections(); void onQuitThread(); void timerEvent(QTimerEvent* event); @@ -49,9 +64,12 @@ signals: void didAddNetwork(const Network); void didScanStatusChanged(const bool); + void didConnectToNetwork(const Network); + void didFailToConnect(const QString); private slots: void onQuit(); void onScanFinished(int, QProcess::ExitStatus); - void onParseWifiScan(const QString &output); + void onParseWifiScan(const QString &vOutput); + void onLogFailure(const QString &vMessage); };