Index: sources/ApplicationPost.cpp =================================================================== diff -u -r7c86f3854db9ad02d95681203198d75a0d65c9fa -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 7c86f3854db9ad02d95681203198d75a0d65c9fa) +++ sources/ApplicationPost.cpp (.../ApplicationPost.cpp) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -36,7 +36,7 @@ */ void ApplicationPost::start() { - QString postLogFileName = qApp->applicationDirPath() + "/" + Storage::POST_LOG; + QString postLogFileName = QDir::tempPath() + "/" + Storage::POST_LOG; if (Storage::FileHandler::read(postLogFileName, _content)) { _isShaSum = checkShaSum (); _isCANBus = checkCANBus (); @@ -64,6 +64,8 @@ isWiFi () && isBluetooth () && isCloudSync () && + // isEthernet () && // it is being executed to get the information but is not part of the POST failure. + // isSound () && isYearCheck () ; } @@ -155,13 +157,46 @@ } /*! + * \brief ApplicationPost::checkEthernet + * \details Checks the Ethernet driver is loaded and functional. + * \return false if there is an issue [Removed from the PRS (always true)]. + */ +bool ApplicationPost::checkEthernet() +{ + bool ok = false; + int posDev = -1; + int posMac = -1; + QString section = ""; + posDev = _content.indexOf( _devEthernet ); if ( posDev < 0 ) goto lOut; + section = _content.mid(posDev, _macAppearLen); + posMac = section.indexOf(_macEthernetLabel); if ( posMac < 0 ) goto lOut; + _macEthernet = section.mid(posMac + _macEthernetLabel.length(), _macAddrssLen).toUpper(); if ( _macEthernet.isEmpty() ) goto lOut; + ok = true; + +lOut: + if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_ETHERNET); + emit didEthernet(ok); + return ok; +} + +/*! * \brief ApplicationPost::checkWiFi * \details Checks the WiFi driver is loaded and functional * \return false if there is an issue. */ bool ApplicationPost::checkWiFi() { - bool ok = _content.contains(_postmsg_wifi + _postmsg_postfix_passed); + bool ok = false; + int posDev = -1; + int posMac = -1; + QString section = ""; + posDev = _content.indexOf( _devWireless ); if ( posDev < 0 ) goto lOut; + section = _content.mid(posDev, _macAppearLen); + posMac = section.indexOf(_macWirelessLabel); if ( posMac < 0 ) goto lOut; + _macWireless = section.mid(posMac + _macWirelessLabel.length(), _macAddrssLen).toUpper(); if ( _macWireless.isEmpty() ) goto lOut; + ok = _content.contains(_postmsg_wifi + _postmsg_postfix_passed); + +lOut: if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_WIFI); emit didWiFi(ok); return ok; @@ -174,7 +209,17 @@ */ bool ApplicationPost::checkBluetooth() { - bool ok = _content.contains(_postmsg_bluetooth + _postmsg_postfix_passed); + bool ok = false; + int posDev = -1; + int posMac = -1; + QString section = ""; + posDev = _content.indexOf( _devBluetooth ); if ( posDev < 0 ) goto lOut; + section = _content.mid(posDev, _macAppearLen); + posMac = section.indexOf(_macBluetoothLabel); if ( posMac < 0 ) goto lOut; + _macBluetooth = section.mid(posMac + _macBluetoothLabel.length(), _macAddrssLen).toUpper(); if ( _macBluetooth.isEmpty() ) goto lOut; + ok = _content.contains(_postmsg_bluetooth + _postmsg_postfix_passed); + +lOut: if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_BLUETOOTH); emit didBluetooth(ok); return ok; @@ -197,20 +242,6 @@ } /*! - * \brief ApplicationPost::checkEthernet - * \details Checks the Ethernet driver is loaded and functional. - * \return false if there is an issue [Removed from the PRS (always true)]. - */ -bool ApplicationPost::checkEthernet() -{ - bool ok = true; - // do the test : we are not using this for now since it has been removed from the PRS. - if (! ok) emit didFail(Gui::GuiAlarmID::ALARM_ID_HD_UI_POST_FAILURE_ETHERNET); - emit didEthernet(ok); - return ok; -} - -/*! * \brief ApplicationPost::checkSound * \details Checks the sound driver is loaded. * \return false if there is an issue [No Implementation yet (always true)].