Index: sources/device/DeviceController.cpp =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -997,7 +997,7 @@ } /*! - * \brief DeviceController::processUSBMountResponse + * \brief DeviceController::processWifiListResponse * \param vExitCode * \param vStatus */ @@ -1019,3 +1019,60 @@ } } +////////////////////////////////////////////////////////////////////////////////////////////////// DeviceWifiInfo +void DeviceController::onAttributeRequest(const DeviceWifiInfoRequestData &) +{ + doGetWifiInfo(); +} + +/*! + * \brief DeviceController::doGetWifiInfo + * \details Calls the Wifi Info script + * \note This function is created to be able to call independently if needed in this class. + */ +void DeviceController::doGetWifiInfo() +{ + // ----- check that script exists. + QString script; + if ( checkError( DeviceError::checkScript(script, Scripts_Wifi_Info), _deviceWifiInfoResponse, script) ) + return; + + // ----- check if the process is not running + if ( _processWifiInfo.state() != QProcess::NotRunning ) { + checkError(DeviceError::eDevice_Scripts_Error_IsRunning, _deviceWifiInfoResponse); + return; + } + + // ----- run the process + int timeout_ms = 10000; + TimedProcess *timedProcess = new TimedProcess(&_processWifiInfo, script, timeout_ms, {}); + timedProcess->start(); + + MDeviceWifiInfoResponse model; + model._data.mCompleted = false; + model._data.mAccepted = false; + model._data.mMessage = tr("WiFi info started."); + emit didAttributeResponse(model.data()); +} + +/*! + * \brief DeviceController::processWifiInfoResponse + * \param vExitCode + * \param vStatus + */ +void DeviceController::processWifiInfoResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel vChannel) +{ + static MDeviceWifiInfoResponse model; + if ( vExitCode < 0 ) { + emit didAttributeResponse(model.data()); + switch (vChannel) { + case QProcess::StandardOutput : processWifiInfoReadyOut(model); break; + case QProcess::StandardError : processWifiInfoReadyErr(model); break; + } + } + else { + processWifiInfoComplete(model, vExitCode, vStatus); + emit didAttributeResponse(model.data()); + model._data.clear(); + } +} Index: sources/device/DeviceController.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceController.h (.../DeviceController.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -232,6 +232,7 @@ void quit(); void doScreenshot(const QImage &vImage, const QString &vFileName); + void doGetWifiInfo(); private slots: void onScreenshot(const QImage &vImage, const QString &vFileName); Index: sources/device/DeviceError.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceError.cpp (.../DeviceError.cpp) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -55,6 +55,7 @@ QT_TR_NOOP("The Decommissioning failed." ), // eDevice_Decommission_Error QT_TR_NOOP("The Brightness failed." ), // eDevice_Brightness_Error QT_TR_NOOP("The WiFi scan failed." ), // eDevice_WifiList_Error + QT_TR_NOOP("The WiFi info failed." ), // eDevice_WifiInfo_Error QT_TR_NOOP("The USB Mount failed." ), // eDevice_USBMount_Error }; Index: sources/device/DeviceError.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceError.h (.../DeviceError.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceError.h (.../DeviceError.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -73,6 +73,7 @@ eDevice_Decommission_Error , eDevice_Brightness_Error , eDevice_WifiList_Error , + eDevice_WifiInfo_Error , eDevice_USBMount_Error , eDevice_Error_End Index: sources/device/DeviceGlobals.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -204,6 +204,7 @@ DEVICE_DEV_PARENT ( Brightness ) \ DEVICE_DEV_PARENT ( USBMount ) \ DEVICE_DEV_PARENT ( WifiList ) \ + DEVICE_DEV_PARENT ( WifiInfo ) \ /* DEVICE_DEV_PARENT ( BluetoothPairedReset ) \ DEVICE_DEV_PARENT ( BluetoothPairedQuery ) \ @@ -218,6 +219,7 @@ DEVICE_DEV_INIT_CONNECTIONS ( Brightness ) \ DEVICE_DEV_INIT_CONNECTIONS ( USBMount ) \ DEVICE_DEV_INIT_CONNECTIONS ( WifiList ) \ + DEVICE_DEV_INIT_CONNECTIONS ( WifiInfo ) \ /* DEVICE_DEV_INIT_CONNECTIONS ( BluetoothPairedReset ) \ DEVICE_DEV_INIT_CONNECTIONS ( BluetoothPairedQuery ) \ @@ -232,6 +234,7 @@ DEVICE_DEV_DEFINITION ( Brightness ) \ DEVICE_DEV_DEFINITION ( USBMount ) \ DEVICE_DEV_DEFINITION ( WifiList ) \ + DEVICE_DEV_DEFINITION ( WifiInfo ) \ /* DEVICE_DEV_DEFINITION ( BluetoothPairedReset ) \ DEVICE_DEV_DEFINITION ( BluetoothPairedQuery ) \ @@ -246,6 +249,7 @@ DEVICE_DEV_DECLARATION ( Brightness ) \ DEVICE_DEV_DECLARATION ( USBMount ) \ DEVICE_DEV_DECLARATION ( WifiList ) \ + DEVICE_DEV_DECLARATION ( WifiInfo ) \ /* DEVICE_DEV_DECLARATION ( BluetoothPairedReset ) \ DEVICE_DEV_DECLARATION ( BluetoothPairedQuery ) \ @@ -261,6 +265,7 @@ #define DEVICE_APP_INIT_CONNECTIONS_LIST \ DEVICE_APP_INIT_CONNECTIONS ( Brightness ) \ DEVICE_APP_INIT_CONNECTIONS ( WifiList ) \ + DEVICE_APP_INIT_CONNECTIONS ( WifiInfo ) \ /* DEVICE_APP_INIT_CONNECTIONS ( BluetoothPairedReset ) \ DEVICE_APP_INIT_CONNECTIONS ( BluetoothPairedQuery ) \ @@ -274,6 +279,7 @@ DEVICE_APP_BRIDGE_DEFINITION( Brightness ) \ DEVICE_APP_BRIDGE_DEFINITION( USBMount ) \ DEVICE_APP_BRIDGE_DEFINITION( WifiList ) \ + DEVICE_APP_BRIDGE_DEFINITION( WifiInfo ) \ /* DEVICE_APP_BRIDGE_DEFINITION( BluetoothPairedReset ) \ DEVICE_APP_BRIDGE_DEFINITION( BluetoothPairedQuery ) \ @@ -289,6 +295,7 @@ #define DEVICE_GUI_INIT_CONNECTIONS_LIST \ DEVICE_GUI_INIT_CONNECTIONS ( Brightness ) \ DEVICE_GUI_INIT_CONNECTIONS ( WifiList ) \ + DEVICE_GUI_INIT_CONNECTIONS ( WifiInfo ) \ /* DEVICE_GUI_INIT_CONNECTIONS ( BluetoothPairedReset ) \ DEVICE_GUI_INIT_CONNECTIONS ( BluetoothPairedQuery ) \ @@ -301,6 +308,7 @@ #define DEVICE_GUI_BRIDGE_DEFINITION_LIST \ DEVICE_GUI_BRIDGE_DEFINITION( Brightness ) \ DEVICE_GUI_BRIDGE_DEFINITION( WifiList ) \ + DEVICE_GUI_BRIDGE_DEFINITION( WifiInfo ) \ /* DEVICE_GUI_BRIDGE_DEFINITION( BluetoothPairedReset ) \ DEVICE_GUI_BRIDGE_DEFINITION( BluetoothPairedQuery ) \ @@ -316,6 +324,7 @@ #define DEVICE_VIEW_INIT_CONNECTIONS_LIST \ DEVICE_VIEW_INIT_CONNECTIONS( Brightness ) \ DEVICE_VIEW_INIT_CONNECTIONS( WifiList ) \ + DEVICE_VIEW_INIT_CONNECTIONS( WifiInfo ) \ /* DEVICE_VIEW_INIT_CONNECTIONS( BluetoothPairedReset ) \ DEVICE_VIEW_INIT_CONNECTIONS( BluetoothPairedQuery ) \ Index: sources/device/DeviceModels.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceModels.cpp (.../DeviceModels.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceModels.cpp (.../DeviceModels.cpp) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -258,6 +258,53 @@ } /*! + * \brief MDeviceWifiInfoResponse::fromByteArray + * \details Checks the response and sets up the model data. + * \param vExitCode - Passed script exit code + * \return true if passed. + */ +bool MDeviceWifiInfoResponse::fromByteArray(const QByteArray &vByteArray, int *vExitCode) +{ + //DEBUG qDebug() << __FUNCTION__ << vByteArray; + + // initialize data + bool ok = false; + int error = 0; + _data.mCompleted = true; + _data.mAccepted = false; + _data.mReason = Device::DeviceError::eDevice_OK; + + // set as default if the val is invalid. + _data.mWifiInfo = ""; + + // get the value + QString val = vByteArray; + ok = ! val.isNull() && val.isSimpleText(); + + // check if the vExitCode passed and it has a value other than zero + if ( ! ok ){ _data.mReason = Device::DeviceError::eDevice_Scripts_Error_Incorrect_Rsp_Type ; goto lError; } // there is not a valid value + if ( vExitCode && *vExitCode ){ _data.mReason = Device::DeviceError::eDevice_WifiInfo_Error ; goto lApply; } // there still a valid value + + // Now everything is good to extract the data + _data.mAccepted = true; + _data.mMessage = QObject::tr("The WiFi info is complete."); goto lApply; // normal return + + // apply returned value in case the passed value is valid (type, range) + // regardless of the exit code (success, fail) +lApply: + _data.mWifiInfo= val; + goto lOut; + + // immediate exit on fail exitcode and invalid returned value. +lError: + if ( vExitCode ) error = *vExitCode; + _data.mMessage = Device::DeviceError::deviceErrorText(static_cast(_data.mReason), error) + "\n" + vByteArray; + +lOut: + return _data.mAccepted; +} + +/*! * \brief MDeviceUSBMountResponse::fromByteArray * \details Checks the response and sets up the model data. * \param vExitCode - Passed script exit code Index: sources/device/DeviceModels.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceModels.h (.../DeviceModels.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceModels.h (.../DeviceModels.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -373,7 +373,7 @@ // ================================================= MDeviceWifiList /*! * \brief The MDeviceMDeviceWifiListRequest class - * \details The model for the Wifi Lsit script call. + * \details The model for the Wifi List script call. */ class MDeviceWifiListRequest : public MDeviceRequestBase { public: @@ -401,6 +401,39 @@ Data data ( ) const { return _data; } bool fromByteArray(const QByteArray &vByteArray, int *vExitCode = nullptr) override; }; + +// ================================================= MDeviceWifiInfo +/*! + * \brief The MDeviceWifiInfoRequest class + * \details The model for the Wifi Info script call. + */ +class MDeviceWifiInfoRequest : public MDeviceRequestBase { +public: + struct Data { + } _data; + + QString toString() { + return MDeviceRequestBase::toString("WifiInfo", {}); + } + + QByteArray toByteArray(Device::DeviceError::Scripts_Error_Enum * = nullptr) override { return ""; } +}; + +/*! + * \brief The MDeviceWifiInfoResponse class + * \details The model for the Wifi Info script call returned value / response. + */ +class MDeviceWifiInfoResponse : public MDeviceResponseBase { +public: + struct Data : MDeviceResponseBase::Data { + QString mWifiInfo = ""; + } _data; + QVariantList parameters ( ) const override { return { }; } + QString infoText ( ) const override { return QString("WifiInfo"); } + Data data ( ) const { return _data; } + bool fromByteArray(const QByteArray &vByteArray, int *vExitCode = nullptr) override; +}; + } typedef Model::MDeviceResponseBase ::Data DeviceResponseBaseData; @@ -432,3 +465,6 @@ typedef Model::MDeviceWifiListRequest ::Data DeviceWifiListRequestData ; typedef Model::MDeviceWifiListResponse ::Data DeviceWifiListResponseData; +typedef Model::MDeviceWifiInfoRequest ::Data DeviceWifiInfoRequestData ; +typedef Model::MDeviceWifiInfoResponse ::Data DeviceWifiInfoResponseData; + Index: sources/device/DeviceView.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -31,6 +31,8 @@ DEVICE_VIEW_INIT_CONNECTIONS_LIST connect(&_DeviceController , SIGNAL(didPOSTOSVersionData(QString)), this , SLOT( onPOSTOSVersionData(QString))); + connect(this , SIGNAL(didGetWifiInfo()), + &_DeviceController , SLOT( doGetWifiInfo())); } // ================================================================================================== @@ -269,6 +271,10 @@ void VDevice::wifiListRequest(const QStringList &) { status( "" ); + ipAddress(""); + gateway(""); + subnetMask(""); + dns(""); wifiList({}); dataClear(); wifiListEnabled(false); @@ -364,7 +370,8 @@ QString mRSN_FLAGS; QStringList fields = lines[row].split(','); - qDebug() << fields.join("-"); +// qDebug() << fields.join("-"); +// LOG_DEBUG(fields.join("-")); // this will never fail since even an empty string in split at least has index 0=eSSID; mSSID = fields[eSSID].trimmed(); if ( mSSID.isEmpty() ) continue; //hidden networks, or an incorrect entry @@ -433,6 +440,11 @@ data.mWifiSupported = ssid.mSupported; data.mWifiConnected = ssid.mInUse ; + if (ssid.mInUse ) { + // called to get wifi info once we are connected + emit didGetWifiInfo(); + } + dataAppend( data, ssid.mInUse, ssid.mSupported); } } @@ -467,9 +479,76 @@ case eRole_WifiSignalLevel : return dataList.mWifiSignalLevel ; case eRole_WifiSupported : return dataList.mWifiSupported ; case eRole_WifiConnected : return dataList.mWifiConnected ; + case eRole_WifiIpAddress : return dataList.mWifiIpAddress ; + case eRole_WifiGateway : return dataList.mWifiGateway ; + case eRole_WifiSubnetMask : return dataList.mWifiSubnetMask ; + case eRole_WifiDns : return dataList.mWifiDns ; + // ----- Bluetooth case eRole_BLE_UNUSED : return ""; ; } return QString("Wifi %1").arg(vIndex.row()); } + +// ================================================= WifiInfo +void VDevice::doInitWifiInfo() { + DeviceWifiInfoRequestData data; + wifiInfo({}); + ipAddress(""); + gateway(""); + subnetMask(""); + dns(""); + + emit didAttributeRequest(data); +} + +void VDevice::wifiInfoRequest(const QStringList &) { + // Nothing to be done here. This property will not be assigned. +} + +void VDevice::onAttributeResponse(const DeviceWifiInfoResponseData &vData) +{ + if ( vData.mCompleted ) { + if ( vData.mAccepted ) { + parseWifiInfoResult(vData.mWifiInfo); + } + else { + wifiInfo({}); + } + } + + accepted(vData.mAccepted); + reason (vData.mReason ); + status (vData.mMessage ); + + // has to be the last one + response(true); +} + +/*! + * \brief Network::parseWifiInfoResult + * \details Extract desired information from the WiFi information output. + * \param vResult - (QString) output collected from QProcess execution + */ +void View::VDevice::parseWifiInfoResult(const QString &vResult) +{ + enum WifiInfo_Enum { + eSSID , + eIPADDRESS , + eSUBNETMASK , + eGATEWAY , + eDNS1 , + eDNS2 , + }; + + QString mResult = vResult; + QStringList fields = mResult.split(','); + ipAddress(fields[eIPADDRESS].trimmed()); + subnetMask(fields[eSUBNETMASK].trimmed()); + gateway(fields[eGATEWAY].trimmed()); + dns(fields[eDNS2].isEmpty() ? fields[eDNS1].trimmed() : + QStringLiteral("%1,\n%2").arg(fields[eDNS1].trimmed()) + .arg(fields[eDNS2].trimmed())); + +} Index: sources/device/DeviceView.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/device/DeviceView.h (.../DeviceView.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -47,6 +47,11 @@ eRole_WifiSignalLevel , eRole_WifiSupported , eRole_WifiConnected , + eRole_WifiIpAddress , + eRole_WifiGateway , + eRole_WifiSubnetMask , + eRole_WifiDns , + // ----- Bluetooth eRole_BLE_UNUSED , }; @@ -59,6 +64,10 @@ { eRole_WifiSignalLevel , "wifiSignalLevel" }, { eRole_WifiSupported , "wifiSupported" }, { eRole_WifiConnected , "wifiConnected" }, + { eRole_WifiIpAddress , "wifiIpAddress" }, + { eRole_WifiGateway , "wifiGateway" }, + { eRole_WifiSubnetMask , "wifiSubnetMask" }, + { eRole_WifiDns , "wifiDns" }, // ----- Bluetooth }; @@ -70,6 +79,11 @@ qint16 mWifiSignalLevel ; bool mWifiSupported = false ; bool mWifiConnected = false ; + QString mWifiIpAddress ; + QString mWifiGateway ; + QString mWifiSubnetMask ; + QString mWifiDns ; + // ----- Bluetooth QString mBle_Unused ; }; @@ -112,14 +126,23 @@ ATTRIBUTE ( QStringList , wifiList , {}, WifiList ) READONLY ( bool , wifiListEnabled , true ) + ATTRIBUTE ( QStringList , wifiInfo , {}, WifiInfo ) + READONLY ( QString , ipAddress , "" ) + READONLY ( QString , gateway , "" ) + READONLY ( QString , subnetMask , "" ) + READONLY ( QString , dns , "" ) VIEW_DEC_CLASS_EX(VDevice, QAbstractListModel) private slots: void onPOSTOSVersionData (const QString &vOSVersion); +signals: + void didGetWifiInfo (); + private: void parseWifiListResult(const QString &vResult); + void parseWifiInfoResult(const QString &vResult); bool isCompleteResponse(Model::MDeviceResponseBase::Data vData) { // Either the script exited successfully or the script failed and the reason is provided // There are situations that the script is using the attribute response to update the UI Index: sources/gui/qml/pages/settings/SettingsWiFi.qml =================================================================== diff -u -r59135abca5be03c9156d3847ccc1befa7132309e -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision 59135abca5be03c9156d3847ccc1befa7132309e) +++ sources/gui/qml/pages/settings/SettingsWiFi.qml (.../SettingsWiFi.qml) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -53,13 +53,13 @@ confirmEnabled : isValid confirmVisible : false // since the static setting is done one by one seems confirm is not needed for now. firstFocusInput : _ipAddress - notificationText: vNetwork.status + notificationText: vDevice.status onConfirmClicked: { - vNetwork.doConfirm( - _ipAddress .textInput.text , - _gateway .textInput.text , - _subnetmask .textInput.text , - _dns .textInput.text ) + vDevice.doConfirm( + _ipAddress .textInput.text , + _gateway .textInput.text , + _subnetmask .textInput.text , + _dns .textInput.text ) } Column { id : _ipColumn @@ -70,52 +70,52 @@ TextEntry { id : _ipAddress nextInput : _gateway // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. - textInput.text : vNetwork.ipAddress + textInput.text : vDevice.ipAddress label.text : qsTr("IP Address") textInput.width : entryWidth label.width : labelWidth - hasCursor : false // set false for now to disable the static IP entry for phase 1 + // hasCursor : false // set false for now to disable the static IP entry for phase 1 validator : ipValidator onEnterPressed : { - vNetwork.doSetIPAddress(textInput.text) + // vDevice.doSetIPAddress(textInput.text) } } TextEntry { id : _gateway nextInput : _subnetmask // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. - textInput.text : vNetwork.gateway + textInput.text : vDevice.gateway textInput.width : entryWidth label.width : labelWidth label.text : qsTr("Gateway") - hasCursor : false // set false for now to disable the static IP entry for phase 1 + // hasCursor : false // set false for now to disable the static IP entry for phase 1 validator : ipValidator onEnterPressed : { - vNetwork.doSetGateway(textInput.text) + // vDevice.doSetGateway(textInput.text) } } TextEntry { id : _subnetmask nextInput : _dns // helps user to tap on enter to go to the next entry, keyboard visibility is handled by TextEntry. - textInput.text : vNetwork.subnetMask + textInput.text : vDevice.subnetMask textInput.width : entryWidth label.width : labelWidth label.text : qsTr("Subnet Mask") - hasCursor : false // set false for now to disable the static IP entry for phase 1 + // hasCursor : false // set false for now to disable the static IP entry for phase 1 validator : ipValidator onEnterPressed : { - vNetwork.doSetSubnetMask(textInput.text) + // vDevice.doSetSubnetMask(textInput.text) } } TextEntry { id : _dns - textInput.text : vNetwork.dns + textInput.text : vDevice.dns textInput.width : entryWidth label.width : labelWidth label.text : qsTr("DNS") - hasCursor : false // set false for now to disable the static IP entry for phase 1 + // hasCursor : false // set false for now to disable the static IP entry for phase 1 validator : ipValidator onEnterPressed : { - vNetwork.doSetDNS(textInput.text) + // vDevice.doSetDNS(textInput.text) } } } @@ -150,18 +150,15 @@ text.text : qsTr("SCAN") width : 350 isDefault : true - // enabled : vDevice.wifiListEnabled - // onClicked : vDevice.wifiList = "" - enabled : !vNetwork.scanInProgress - onClicked : vNetwork.doScan() + enabled : vDevice.wifiListEnabled + onClicked : vDevice.wifiList = "" } ScrollBar { flickable : _networkList anchors.fill: _networkList } ListView { id : _networkList - // model : vDevice - model : vNetwork + model : vDevice clip : true spacing : 7 y : _root.topMargin @@ -178,6 +175,7 @@ onIsConnectedChanged: { if ( isConnected ) { _ssidText.text = wifiSsid + } } @@ -234,17 +232,17 @@ property string macAddress : "" property string separator : "\n\n" readonly property string spaceSeparator : " " - notificationText : vNetwork.status + notificationText : vDevice.status message : qsTr("Do you want to disconnect from `%1`?").arg(ssid) title : isPassword ? qsTr("Join") + separator + ssid + spaceSeparator + qsTr("Password") : qsTr("Disconnect") + separator + ssid onConfirmClicked : { if ( isPassword ) { if( passwordCurrent.length > 0 ) { - vNetwork.doJoinNetwork ( macAddress, passwordCurrent ) + // vNetwork.doJoinNetwork ( macAddress, passwordCurrent ) pop() } } else { - vNetwork.doDisconnectNetwork( macAddress ) + // vNetwork.doDisconnectNetwork( macAddress ) pop() } } Index: sources/model/MModel.h =================================================================== diff -u -rd862dfcd402206e33b314c458e41c13b684a4565 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/model/MModel.h (.../MModel.h) (revision d862dfcd402206e33b314c458e41c13b684a4565) +++ sources/model/MModel.h (.../MModel.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -309,6 +309,8 @@ REGISTER_METATYPE( DeviceUSBMountResponseData ) \ REGISTER_METATYPE( DeviceWifiListRequestData ) \ REGISTER_METATYPE( DeviceWifiListResponseData ) \ + REGISTER_METATYPE( DeviceWifiInfoRequestData ) \ + REGISTER_METATYPE( DeviceWifiInfoResponseData ) \ /* Settings */ \ REGISTER_METATYPE( SettingsData ) \ REGISTER_METATYPE( BluetoothData ) \ Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r59135abca5be03c9156d3847ccc1befa7132309e -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 59135abca5be03c9156d3847ccc1befa7132309e) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -182,6 +182,7 @@ // WiFi Settings const char *Scripts_Wifi_Scan = "wifi_scan.sh"; + const char *Scripts_Wifi_Info = "wifi_info.sh"; const char *Scripts_Wifi_Disconnect = "wifi_disconnect.sh"; const char *Scripts_Wifi_Active_Info = "wifi_active_info.sh"; const char *Scripts_Wifi_Connect_Dhcp = "wifi_connect_dhcp.sh"; Index: sources/storage/StorageGlobals.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/storage/StorageGlobals.h (.../StorageGlobals.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -106,6 +106,7 @@ extern const char *Wifi_Reset_Adapter; extern const char *Wifi_Reset_Interface; extern const char *Scripts_Wifi_Scan; + extern const char *Scripts_Wifi_Info; extern const char *Wifi_Set_Auto_Assigned_IP; extern const char *Wifi_Set_DNS; extern const char *Wifi_Set_Static_IP; Index: sources/view/VView.h =================================================================== diff -u -r59135abca5be03c9156d3847ccc1befa7132309e -r6f480a8d61165dd24cf8da7e9e637f89147303c3 --- sources/view/VView.h (.../VView.h) (revision 59135abca5be03c9156d3847ccc1befa7132309e) +++ sources/view/VView.h (.../VView.h) (revision 6f480a8d61165dd24cf8da7e9e637f89147303c3) @@ -135,7 +135,6 @@ REGISTER_TYPE( VAdjustmentServiceMode ) \ REGISTER_TYPE( VAdjustmentServiceDates ) \ REGISTER_TYPE( VDateTime ) \ - REGISTER_TYPE( VNetworkModel ) \ REGISTER_TYPE( VAdjustmentAlarmVolume ) \ REGISTER_TYPE( VBluetooth ) \ REGISTER_TYPE( VDuetRoWaterDG ) \