Index: sources/ApplicationPost.h =================================================================== diff -u -rc73feffa73c7fe073a7a7581144f5806dfc91beb -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/ApplicationPost.h (.../ApplicationPost.h) (revision c73feffa73c7fe073a7a7581144f5806dfc91beb) +++ sources/ApplicationPost.h (.../ApplicationPost.h) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,13 +1,13 @@ /*! * - * Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 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 ApplicationPost.h - * \author (last) Vy - * \date (last) 13-Apr-2023 + * \author (last) Behrouz NematiPour + * \date (last) 10-Sep-2023 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * @@ -58,33 +58,37 @@ QString _content; // WARNING: these variables has to match with the ones in the run.sh. - const QString _postmsg_postfix_passed = " passed" ; // POSTMSG_POSTFIX_PASSED=" passed" - const QString _postmsg_postfix_failed = " failed" ; // POSTMSG_POSTFIX_FAILED=" failed" + const QString _postmsg_postfix_passed = " passed" ; // POSTMSG_POSTFIX_PASSED=" passed" + const QString _postmsg_postfix_failed = " failed" ; // POSTMSG_POSTFIX_FAILED=" failed" - const QString _postmsg_canbus = "CANBus" ; // POSTMSG_CANBUS="CANBus" - const QString _postmsg_sdcard = "SD-CARD" ; // POSTMSG_SDCARD="SD-CARD" - const QString _postmsg_touch = "Touch" ; // POSTMSG_TOUCH="Touch" - const QString _postmsg_rtc = "RTC" ; // POSTMSG_RTC="RTC" - const QString _postmsg_wifi = "WiFi" ; // POSTMSG_WIFI="WiFi" - const QString _postmsg_bluetooth = "Bluetooth" ; // POSTMSG_BLUETOOTH="Bluetooth" - const QString _postmsg_shasum = "App shasum" ; // POSTMSG_SHASUM="App shasum" - const QString _postmsg_cloudsync = "CloudSync" ; // POSTMSG_CLOUDSYNC="CloudSync" + const QString _postmsg_osversion = "DIALITY_VERSION_ID=" ; // DIALITY_VERSION_ID="0.0.40" + const QString _postmsg_osbuild = "BUILD_ID=" ; // BUILD_ID="20230628230011" + const QString _postmsg_canbus = "CANBus" ; // POSTMSG_CANBUS="CANBus" + const QString _postmsg_sdcard = "SD-CARD" ; // POSTMSG_SDCARD="SD-CARD" + const QString _postmsg_touch = "Touch" ; // POSTMSG_TOUCH="Touch" + const QString _postmsg_rtc = "RTC" ; // POSTMSG_RTC="RTC" + const QString _postmsg_wifi = "WiFi" ; // POSTMSG_WIFI="WiFi" + const QString _postmsg_bluetooth = "Bluetooth" ; // POSTMSG_BLUETOOTH="Bluetooth" + const QString _postmsg_shasum = "App shasum" ; // POSTMSG_SHASUM="App shasum" + const QString _postmsg_cloudsync = "CloudSync" ; // POSTMSG_CLOUDSYNC="CloudSync" - const quint8 _macAddrssLen = 17 ; // ff:ff:ff:ff:ff:ff - const quint8 _macAppearLen = 200 ; // the mac address shall be found within the next 200 characters. - const QString _devEthernet = "eth0:" ; - const QString _devWireless = "wlan0:" ; - const QString _devBluetooth = "hci0:" ; - const QString _macEthernetLabel = "link/ether " ; // the last space is important - const QString _macWirelessLabel = "link/ether " ; // the last space is important - const QString _macBluetoothLabel = "BD Address: "; // the last space is important - QString _macEthernet = "" ; - QString _macWireless = "" ; - QString _macBluetooth = "" ; + const quint8 _macAddrssLen = 17 ; // ff:ff:ff:ff:ff:ff + const quint8 _macAppearLen = 200 ; // the mac address shall be found within the next 200 characters. + const QString _devEthernet = "eth0:" ; + const QString _devWireless = "wlan0:" ; + const QString _devBluetooth = "hci0:" ; + const QString _macEthernetLabel = "link/ether " ; // the last space is important + const QString _macWirelessLabel = "link/ether " ; // the last space is important + const QString _macBluetoothLabel = "BD Address: " ; // the last space is important + QString _osVersion = "" ; + QString _macEthernet = "" ; + QString _macWireless = "" ; + QString _macBluetooth = "" ; - const int _yearMinimum = 2022 ; // The year to check for minimum + const int _yearMinimum = 2022 ; // The year to check for minimum // tests // Severity + bool _isOSVersion = false ; // HIGH: fault: ALARM_ID_HD_UI_POST_FAILURE_OS_VERSION bool _isShaSum = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_SHASUM bool _isCANBus = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_CANBUS bool _isDisplay = false ; // HIGH: fault: ALARM_ID_UI_POST_FAILURE_DISPLAY : Not known way to test, other than visual check @@ -97,8 +101,10 @@ bool _isEthernet = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_ETHERNET : this is not a Fault and not required the application to stop. bool _isSound = false ; // HIGH: : ALARM_ID_UI_POST_FAILURE_SOUND : this is not a Fault and not required the application to stop. bool _isYearCheck = false ; // HIGH: : ALARM_ID_HD_UI_POST_FAILURE_INVALID_YEAR + bool _isDone = false ; + bool checkOSVersion (); bool checkShaSum (); bool checkCANBus (); bool checkDisplay (); @@ -113,6 +119,7 @@ bool checkYear (); public: + bool isOSVersion () const { return _isOSVersion ; } bool isShaSum () const { return _isShaSum ; } bool isCANBus () const { return _isCANBus ; } bool isDisplay () const { return _isDisplay ; } @@ -126,7 +133,19 @@ bool isSound () const { return _isSound ; } bool isYearCheck () const { return _isYearCheck ; } bool isDone () const { return _isDone ; } + /*! + * \brief isDone + * \details set the isDone private member with the given vDone and returns it. + * There are some items related to POST but are running outside of this class, + * like initSettings result, cryptsetup mount (which includes CRC too) + * \param vDone - a bool parameter to and with the current done result + * \return bool value of the _isDone private property + */ + bool isDone (bool vDone) { _isDone = _isDone && vDone; + return _isDone; + } + QString osVersion () const { return _osVersion ; } QString macEthernet () const { return _macEthernet ; } QString macWireless () const { return _macWireless ; } QString macBluetooth () const { return _macBluetooth ; } @@ -136,6 +155,7 @@ void start(); signals: + void didOSVersion (bool vPass); void didShaSum (bool vPass); void didCANBus (bool vPass); void didDisplay (bool vPass);