Index: sources/device/DeviceView.cpp =================================================================== diff -u -r1f031754af6e570cf1e4f74d1620bdac2b31842c -r2a0e56982ad45cdd98a6d0425c53e52610c29961 --- sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 1f031754af6e570cf1e4f74d1620bdac2b31842c) +++ sources/device/DeviceView.cpp (.../DeviceView.cpp) (revision 2a0e56982ad45cdd98a6d0425c53e52610c29961) @@ -150,6 +150,13 @@ // Nothing for now. } +void VDevice::factoryResetRequest(const QString &vCommand) { + Q_UNUSED(vCommand) + // DEBUG : qDebug() << "HERE Request" << vCommand; + DeviceFactoryResetRequestData data; + emit didAttributeRequest(data); +} + void VDevice::onAttributeResponse(const DeviceFactoryResetResponseData &vData) { // QDEBUG : qDebug() << "HERE Response " << Q_FUNC_INFO << " accepted: " << vData.mAccepted; // this has to be called to let Gui to set to old value that device controller provided. @@ -165,18 +172,26 @@ response(true); } -void VDevice::factoryResetRequest(const QString &vCommand) { - Q_UNUSED(vCommand) - // DEBUG : qDebug() << "HERE Request" << vCommand; - DeviceFactoryResetRequestData data; - emit didAttributeRequest(data); -} - // ================================================= Decommission void VDevice::doInitDecommission() { // Nothing for now. } +void VDevice::decommissionRequest(const QString &vCommand) { + Q_UNUSED(vCommand) + // DEBUG : qDebug() << "HERE Request" << vCommand; + DeviceDecommissionRequestData data; + bool ok = false; + data.mPassword = encryption::defaultServicePassword( ok ); + if ( ! ok ) { // not enough infromation to create a secure passowrd + status(tr("Not enough secure information provided")); + } + else { + emit didAttributeRequest(data); + } + emit didAttributeRequest(data); +} + void VDevice::onAttributeResponse(const DeviceDecommissionResponseData &vData) { //QDEBUG : qDebug() << "HERE Response " << Q_FUNC_INFO << " accepted: "<< vData.mAccepted << vData.mReason; // this has to be called to let Gui to set to old value that device controller provided. @@ -191,11 +206,3 @@ // has to be the last one response(true); } - -void VDevice::decommissionRequest(const QString &vCommand) { - Q_UNUSED(vCommand) - // DEBUG : qDebug() << "HERE Request" << vCommand; - DeviceDecommissionRequestData data; - emit didAttributeRequest(data); -} -