Index: sources/device/DeviceView.cpp =================================================================== diff -u -r2a0e56982ad45cdd98a6d0425c53e52610c29961 -r5a4a26f106ba03759e3a89b19690fa678f8a3aca --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 2a0e56982ad45cdd98a6d0425c53e52610c29961) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 5a4a26f106ba03759e3a89b19690fa678f8a3aca) @@ -72,7 +72,7 @@ DeviceCryptSetupRequestData data; data.mCommand = vCommand; bool ok = false; - data.mPassword = encryption::defaultServicePassword( ok ); + data.mPassword = encryption::configurationsPassword( ok ); if ( ! ok ) { // not enough infromation to create a secure passowrd status(tr("Not enough secure information provided")); } @@ -145,6 +145,41 @@ response(true); } +/// ---------- RootSSHAccess +void VDevice::doInitRootSSHAccess() { + // DEBUG : qDebug() << "HERE Request" << vValue; + DeviceRootSSHAccessRequestData data; + data.mIsGet = true; + emit didAttributeRequest(data); +} + +void VDevice::rootSSHAccessRequest(const bool &vValue) { + // DEBUG : qDebug() << "HERE Request" << vValue; + DeviceRootSSHAccessRequestData data; + data.mIsGet = false; + data.mRootSSHAccess = vValue; + emit didAttributeRequest(data); +} + +void VDevice::onAttributeResponse(const DeviceRootSSHAccessResponseData &vData) { + // DEBUG : qDebug() << "HERE Response" << vData.mBrightnessPercent; + if ( vData.mAccepted ) { + rootSSHAccess(vData.mRootSSHAccess); + status(""); + } + else { + // this has to be called to let Gui to set to old value that device controller provided. + emit rootSSHAccessChanged(vData.mRootSSHAccess); + status(vData.mMessage); + } + + accepted(vData.mAccepted); + reason (vData.mReason ); + + // has to be the last one + response(true); +} + // ================================================= Factory Reset void VDevice::doInitFactoryReset() { // Nothing for now. @@ -182,7 +217,7 @@ // DEBUG : qDebug() << "HERE Request" << vCommand; DeviceDecommissionRequestData data; bool ok = false; - data.mPassword = encryption::defaultServicePassword( ok ); + data.mPassword = encryption::configurationsPassword( ok ); if ( ! ok ) { // not enough infromation to create a secure passowrd status(tr("Not enough secure information provided")); }