active SD Info event #752

Merged
muellerr merged 7 commits from active-sd-info-event into main 2023-07-21 13:56:14 +02:00
12 changed files with 26 additions and 12 deletions
Showing only changes of commit 7bedb1d307 - Show all commits

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 301 translations. * @brief Auto-generated event translation file. Contains 301 translations.
* @details * @details
* Generated on: 2023-07-21 10:26:17 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateEvents.h" #include "translateEvents.h"

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 171 translations. * Contains 171 translations.
* Generated on: 2023-07-21 10:25:32 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -183,7 +183,7 @@ ReturnValue_t CoreController::initialize() {
announceVersionInfo(); announceVersionInfo();
SdCardManager::SdStatePair sdStates; SdCardManager::SdStatePair sdStates;
sdcMan->getSdCardsStatus(sdStates); sdcMan->getSdCardsStatus(sdStates);
triggerEvent(core::ACTIVE_SD_INFO, sdStates.first, sdStates.second); announceSdInfo(sdStates);
sdStateMachine(); sdStateMachine();
result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0); result = scratch::writeNumber(scratch::ALLOC_FAILURE_COUNT, 0);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -801,6 +801,7 @@ ReturnValue_t CoreController::sdStateMachine() {
} }
sif::info << "SD card update into " << modeStr sif::info << "SD card update into " << modeStr
<< " mode finished. Active SD: " << sdInfo.activeChar << std::endl; << " mode finished. Active SD: " << sdInfo.activeChar << std::endl;
announceSdInfo(sdInfo.currentState);
if (not sdInfo.initFinished) { if (not sdInfo.initFinished) {
updateInternalSdInfo(); updateInternalSdInfo();
sdInfo.initFinished = true; sdInfo.initFinished = true;
@ -2571,6 +2572,17 @@ ReturnValue_t CoreController::performGracefulShutdown(xsc::Chip tgtChip, xsc::Co
return returnvalue::OK; return returnvalue::OK;
} }
void CoreController::announceSdInfo(SdCardManager::SdStatePair sdStates) {
auto activeSdCard = sdcMan->getActiveSdCard();
uint32_t p1 = sd::SdCard::NONE;
if (activeSdCard.has_value()) {
p1 = static_cast<uint32_t>(activeSdCard.value());
}
uint32_t p2 =
(static_cast<uint32_t>(sdStates.first) << 16) | static_cast<uint32_t>(sdStates.second);
triggerEvent(core::ACTIVE_SD_INFO, p1, p2);
}
bool CoreController::isNumber(const std::string &s) { bool CoreController::isNumber(const std::string &s) {
return !s.empty() && std::find_if(s.begin(), s.end(), return !s.empty() && std::find_if(s.begin(), s.end(),
[](unsigned char c) { return !std::isdigit(c); }) == s.end(); [](unsigned char c) { return !std::isdigit(c); }) == s.end();

View File

@ -388,6 +388,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe
void announceBootCounts(); void announceBootCounts();
void announceVersionInfo(); void announceVersionInfo();
void announceCurrentImageInfo(); void announceCurrentImageInfo();
void announceSdInfo(SdCardManager::SdStatePair sdStates);
void readHkData(); void readHkData();
void dirListingDumpHandler(); void dirListingDumpHandler();
bool isNumber(const std::string& s); bool isNumber(const std::string& s);

View File

@ -273,7 +273,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
14011;0x36bb;I2C_REBOOT;HIGH;I2C is unavailable. Recovery did not work, performing full reboot.;mission/sysDefs.h 14011;0x36bb;I2C_REBOOT;HIGH;I2C is unavailable. Recovery did not work, performing full reboot.;mission/sysDefs.h
14012;0x36bc;PDEC_REBOOT;HIGH;PDEC recovery through reset was not possible, performing full reboot.;mission/sysDefs.h 14012;0x36bc;PDEC_REBOOT;HIGH;PDEC recovery through reset was not possible, performing full reboot.;mission/sysDefs.h
14013;0x36bd;FIRMWARE_INFO;INFO;Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;mission/sysDefs.h 14013;0x36bd;FIRMWARE_INFO;INFO;Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;mission/sysDefs.h
14014;0x36be;ACTIVE_SD_INFO;INFO;Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 2.;mission/sysDefs.h 14014;0x36be;ACTIVE_SD_INFO;INFO;Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 1.;mission/sysDefs.h
14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;No description;mission/controller/tcsDefs.h 14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;No description;mission/controller/tcsDefs.h
14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;No description;mission/controller/tcsDefs.h 14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;No description;mission/controller/tcsDefs.h
14102;0x3716;SYRLINKS_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14102;0x3716;SYRLINKS_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
273 14011 0x36bb I2C_REBOOT HIGH I2C is unavailable. Recovery did not work, performing full reboot. mission/sysDefs.h
274 14012 0x36bc PDEC_REBOOT HIGH PDEC recovery through reset was not possible, performing full reboot. mission/sysDefs.h
275 14013 0x36bd FIRMWARE_INFO INFO Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set. mission/sysDefs.h
276 14100 14014 0x3714 0x36be NO_VALID_SENSOR_TEMPERATURE ACTIVE_SD_INFO MEDIUM INFO No description Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 1. mission/controller/tcsDefs.h mission/sysDefs.h
277 14101 14100 0x3715 0x3714 NO_HEALTHY_HEATER_AVAILABLE NO_VALID_SENSOR_TEMPERATURE MEDIUM No description mission/controller/tcsDefs.h
278 14102 14101 0x3716 0x3715 SYRLINKS_OVERHEATING NO_HEALTHY_HEATER_AVAILABLE HIGH MEDIUM No description mission/controller/tcsDefs.h
279 14104 14102 0x3718 0x3716 OBC_OVERHEATING SYRLINKS_OVERHEATING HIGH No description mission/controller/tcsDefs.h

View File

@ -273,7 +273,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
14011;0x36bb;I2C_REBOOT;HIGH;I2C is unavailable. Recovery did not work, performing full reboot.;mission/sysDefs.h 14011;0x36bb;I2C_REBOOT;HIGH;I2C is unavailable. Recovery did not work, performing full reboot.;mission/sysDefs.h
14012;0x36bc;PDEC_REBOOT;HIGH;PDEC recovery through reset was not possible, performing full reboot.;mission/sysDefs.h 14012;0x36bc;PDEC_REBOOT;HIGH;PDEC recovery through reset was not possible, performing full reboot.;mission/sysDefs.h
14013;0x36bd;FIRMWARE_INFO;INFO;Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;mission/sysDefs.h 14013;0x36bd;FIRMWARE_INFO;INFO;Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set.;mission/sysDefs.h
14014;0x36be;ACTIVE_SD_INFO;INFO;Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 2.;mission/sysDefs.h 14014;0x36be;ACTIVE_SD_INFO;INFO;Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 1.;mission/sysDefs.h
14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;No description;mission/controller/tcsDefs.h 14100;0x3714;NO_VALID_SENSOR_TEMPERATURE;MEDIUM;No description;mission/controller/tcsDefs.h
14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;No description;mission/controller/tcsDefs.h 14101;0x3715;NO_HEALTHY_HEATER_AVAILABLE;MEDIUM;No description;mission/controller/tcsDefs.h
14102;0x3716;SYRLINKS_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14102;0x3716;SYRLINKS_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
273 14011 0x36bb I2C_REBOOT HIGH I2C is unavailable. Recovery did not work, performing full reboot. mission/sysDefs.h
274 14012 0x36bc PDEC_REBOOT HIGH PDEC recovery through reset was not possible, performing full reboot. mission/sysDefs.h
275 14013 0x36bd FIRMWARE_INFO INFO Version information of the firmware (not OBSW). P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash P2: First four letters of Git SHA is the last byte of P1 is set. mission/sysDefs.h
276 14100 14014 0x3714 0x36be NO_VALID_SENSOR_TEMPERATURE ACTIVE_SD_INFO MEDIUM INFO No description Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. P1: SD Card 0, P2: SD Card 1. mission/controller/tcsDefs.h mission/sysDefs.h
277 14101 14100 0x3715 0x3714 NO_HEALTHY_HEATER_AVAILABLE NO_VALID_SENSOR_TEMPERATURE MEDIUM No description mission/controller/tcsDefs.h
278 14102 14101 0x3716 0x3715 SYRLINKS_OVERHEATING NO_HEALTHY_HEATER_AVAILABLE HIGH MEDIUM No description mission/controller/tcsDefs.h
279 14104 14102 0x3718 0x3716 OBC_OVERHEATING SYRLINKS_OVERHEATING HIGH No description mission/controller/tcsDefs.h

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 301 translations. * @brief Auto-generated event translation file. Contains 301 translations.
* @details * @details
* Generated on: 2023-07-21 10:26:17 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateEvents.h" #include "translateEvents.h"

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 175 translations. * Contains 175 translations.
* Generated on: 2023-07-21 10:25:32 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 301 translations. * @brief Auto-generated event translation file. Contains 301 translations.
* @details * @details
* Generated on: 2023-07-21 10:26:17 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateEvents.h" #include "translateEvents.h"

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 175 translations. * Contains 175 translations.
* Generated on: 2023-07-21 10:25:32 * Generated on: 2023-07-21 11:04:23
*/ */
#include "translateObjects.h" #include "translateObjects.h"

View File

@ -125,8 +125,9 @@ static constexpr Event PDEC_REBOOT = event::makeEvent(SUBSYSTEM_ID, 12, severity
//! P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash //! P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash
//! P2: First four letters of Git SHA is the last byte of P1 is set. //! P2: First four letters of Git SHA is the last byte of P1 is set.
static constexpr Event FIRMWARE_INFO = event::makeEvent(SUBSYSTEM_ID, 13, severity::INFO); static constexpr Event FIRMWARE_INFO = event::makeEvent(SUBSYSTEM_ID, 13, severity::INFO);
//! [EXPORT] : [COMMENT] Active SD card info. 0: OFF, 1: ON, 2: MOUNTED. //! [EXPORT] : [COMMENT] Active SD card info. SD States: 0: OFF, 1: ON, 2: MOUNTED.
//! P1: SD Card 0, P2: SD Card 2. //! P1: Active SD Card Index, 0 if none is active
//! P2: First two bytes: SD state of SD card 0, last two bytes SD state of SD card 1
static constexpr Event ACTIVE_SD_INFO = event::makeEvent(SUBSYSTEM_ID, 14, severity::INFO); static constexpr Event ACTIVE_SD_INFO = event::makeEvent(SUBSYSTEM_ID, 14, severity::INFO);
class ListDirectoryCmdBase { class ListDirectoryCmdBase {

2
tmtc

@ -1 +1 @@
Subproject commit 40c086086b6ad0a3707420a12d6185e8dcf2abf2 Subproject commit fd6b76bfdde8351bcf848e5a13700fee14ae1254