Index: sources/device/DeviceView.h =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rbabe585dd9603621275742b07135c0fd4181802f --- sources/device/DeviceView.h (.../DeviceView.h) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision babe585dd9603621275742b07135c0fd4181802f) @@ -47,6 +47,7 @@ eRole_WifiSignalLevel , eRole_WifiSupported , eRole_WifiConnected , + // ----- Bluetooth eRole_BLE_UNUSED , }; @@ -70,6 +71,11 @@ qint16 mWifiSignalLevel ; bool mWifiSupported = false ; bool mWifiConnected = false ; + QString mWifiIpAddress ; + QString mWifiGateway ; + QString mWifiSubnetMask ; + QString mWifiDns ; + // ----- Bluetooth QString mBle_Unused ; }; @@ -82,6 +88,8 @@ QVariant data (const QModelIndex &vIndex , int vRole = Qt::DisplayRole ) const override ; void dataAppend (const DataModel &vData , bool vFirst , bool vSecond); void dataClear ( ); + bool setData (const QModelIndex &vIndex, const QVariant& vValue, int vRole = Qt::EditRole) override; + QModelIndex index (int vRow, int vColumn, const QModelIndex &vParent = QModelIndex()) const override; private: @@ -111,15 +119,28 @@ READONLY ( bool , decommissionEnabled , true ) ATTRIBUTE ( QStringList , wifiList , {}, WifiList ) + ATTRIBUTE ( QStringList , wifiInfo , {}, WifiInfo ) + ATTRIBUTE ( bool , wifiConnect , false, WifiConnect ) READONLY ( bool , wifiListEnabled , true ) + READONLY ( QString , ssid , "" ) + READONLY ( QString , ipAddress , "" ) + READONLY ( QString , gateway , "" ) + READONLY ( QString , subnetMask , "" ) + READONLY ( QString , dns , "" ) VIEW_DEC_CLASS_EX(VDevice, QAbstractListModel) +public slots: + void doWifiConnect(bool vConnect, const QString &vSsid, const QString &vPassword); + private slots: void onPOSTOSVersionData (const QString &vOSVersion); private: void parseWifiListResult(const QString &vResult); + void parseWifiInfoResult(const QString &vResult); + void updateWifiList(); + 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