Index: sources/device/DeviceView.h =================================================================== diff -u -rb7c9de054c6b7a1ca4bac9fbb0ec5d4ac06620a9 -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/device/DeviceView.h (.../DeviceView.h) (revision b7c9de054c6b7a1ca4bac9fbb0ec5d4ac06620a9) +++ sources/device/DeviceView.h (.../DeviceView.h) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file DeviceView.h * \author (last) Behrouz NematiPour - * \date (last) 01-Jun-2021 + * \date (last) 11-Nov-2021 * \author (original) Behrouz NematiPour - * \date (original) 01-Jun-2021 + * \date (original) 03-Jun-2021 * */ #pragma once @@ -36,16 +36,36 @@ class VDevice : public QObject { Q_OBJECT - TRIGGER ( bool , response , true) + TRIGGER ( bool , response , true) - PROPERTY ( bool , accepted , 0) - TRIGGER ( quint32 , reason , 0) - PROPERTY ( QString , status , "") + PROPERTY ( bool , accepted , 0) + TRIGGER ( quint32 , reason , 0) + PROPERTY ( QString , status , "") - ATTRIBUTE ( quint8 , brightness , 0, Brightness ) + ATTRIBUTE ( quint8 , brightness , 0, Brightness ) - ATTRIBUTE ( quint8 , bluetoothPairedReset, 0, BluetoothPairedReset ) + ATTRIBUTE ( quint8 , bluetoothPairedReset, 0, BluetoothPairedReset ) + ATTRIBUTE ( QStringList , bluetoothPairedQuery, {}, BluetoothPairedQuery ) + ATTRIBUTE ( QString , cryptSetup , "", CryptSetup ) + PROPERTY ( bool , cryptSetupEnabled , true ) + + ATTRIBUTE ( bool , rootSSHAccess , false, RootSSHAccess ) + + ATTRIBUTE ( QString , factoryReset , "", FactoryReset ) + PROPERTY ( bool , factoryResetEnabled , true ) + + ATTRIBUTE ( QString , decommission , "", Decommission ) + PROPERTY ( bool , decommissionEnabled , true ) + VIEW_DEC_CLASS(VDevice) + +private: + 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 + // but it is not the final/completed response + return vData.mAccepted || (!vData.mAccepted && vData.mReason != 0 ); + } }; }