Merge remote-tracking branch 'origin/main' into relax-sus-fdir
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good
This commit is contained in:
@ -21,6 +21,7 @@ GpsHyperionLinuxController::GpsHyperionLinuxController(object_id_t objectId, obj
|
||||
bool enableHkSets, bool debugHyperionGps)
|
||||
: ExtendedControllerBase(objectId),
|
||||
gpsSet(this),
|
||||
skyviewSet(this),
|
||||
enableHkSets(enableHkSets),
|
||||
debugHyperionGps(debugHyperionGps) {}
|
||||
|
||||
@ -29,7 +30,17 @@ GpsHyperionLinuxController::~GpsHyperionLinuxController() {
|
||||
gps_close(&gps);
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) { return &gpsSet; }
|
||||
LocalPoolDataSetBase *GpsHyperionLinuxController::getDataSetHandle(sid_t sid) {
|
||||
switch (sid.ownerSetId) {
|
||||
case GpsHyperion::CORE_DATASET:
|
||||
return &gpsSet;
|
||||
case GpsHyperion::SKYVIEW_DATASET:
|
||||
return &skyviewSet;
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ReturnValue_t GpsHyperionLinuxController::checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
@ -90,6 +101,13 @@ ReturnValue_t GpsHyperionLinuxController::initializeLocalDataPool(
|
||||
localDataPoolMap.emplace(GpsHyperion::SATS_IN_VIEW, new PoolEntry<uint8_t>());
|
||||
localDataPoolMap.emplace(GpsHyperion::FIX_MODE, new PoolEntry<uint8_t>());
|
||||
poolManager.subscribeForRegularPeriodicPacket({gpsSet.getSid(), enableHkSets, 30.0});
|
||||
localDataPoolMap.emplace(GpsHyperion::SKYVIEW_UNIX_SECONDS, new PoolEntry<double>());
|
||||
localDataPoolMap.emplace(GpsHyperion::PRN_ID, new PoolEntry<int16_t>());
|
||||
localDataPoolMap.emplace(GpsHyperion::AZIMUTH, new PoolEntry<int16_t>());
|
||||
localDataPoolMap.emplace(GpsHyperion::ELEVATION, new PoolEntry<int16_t>());
|
||||
localDataPoolMap.emplace(GpsHyperion::SIGNAL2NOISE, new PoolEntry<double>());
|
||||
localDataPoolMap.emplace(GpsHyperion::USED, new PoolEntry<uint8_t>());
|
||||
poolManager.subscribeForRegularPeriodicPacket({skyviewSet.getSid(), false, 120.0});
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -166,30 +184,32 @@ bool GpsHyperionLinuxController::readGpsDataFromGpsd() {
|
||||
if (mode == MODE_OFF) {
|
||||
return false;
|
||||
}
|
||||
unsigned int readIdx = 0;
|
||||
if (readMode == ReadModes::SOCKET) {
|
||||
// Poll the GPS.
|
||||
if (gps_waiting(&gps, 0)) {
|
||||
if (-1 == gps_read(&gps)) {
|
||||
while (gps_waiting(&gps, 0)) {
|
||||
int retval = gps_read(&gps);
|
||||
if (retval < 0) {
|
||||
readError();
|
||||
return false;
|
||||
}
|
||||
oneShotSwitches.gpsReadFailedSwitch = true;
|
||||
ReturnValue_t result = handleGpsReadData();
|
||||
if (result == returnvalue::OK) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
readIdx++;
|
||||
if (readIdx >= 40) {
|
||||
sif::warning << "GpsHyperionLinuxController: Received " << readIdx
|
||||
<< " GPSD message consecutively" << std::endl;
|
||||
break;
|
||||
}
|
||||
noModeSetCntr = 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (readIdx > 0) {
|
||||
oneShotSwitches.gpsReadFailedSwitch = true;
|
||||
handleGpsReadData();
|
||||
}
|
||||
} else if (readMode == ReadModes::SHM) {
|
||||
sif::error << "GpsHyperionLinuxController::readGpsDataFromGpsdPermanentLoop: "
|
||||
"SHM read not implemented"
|
||||
<< std::endl;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
||||
@ -208,7 +228,15 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
ReturnValue_t result = handleCoreTelemetry(modeIsSet);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = handleSkyviewTelemetry();
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) {
|
||||
PoolReadGuard pg(&gpsSet);
|
||||
if (pg.getReadResult() != returnvalue::OK) {
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
@ -236,7 +264,9 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
||||
}
|
||||
}
|
||||
if (gpsSet.fixMode.value != newFix) {
|
||||
#if OBSW_Q7S_EM != 1
|
||||
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFix);
|
||||
#endif
|
||||
}
|
||||
gpsSet.fixMode = newFix;
|
||||
gpsSet.fixMode.setValid(modeIsSet);
|
||||
@ -369,6 +399,22 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t GpsHyperionLinuxController::handleSkyviewTelemetry() {
|
||||
PoolReadGuard pg(&skyviewSet);
|
||||
if (pg.getReadResult() != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
skyviewSet.unixSeconds.value = gps.skyview_time;
|
||||
for (int sat = 0; sat < GpsHyperion::MAX_SATELLITES; sat++) {
|
||||
skyviewSet.prn_id.value[sat] = gps.skyview[sat].PRN;
|
||||
skyviewSet.azimuth.value[sat] = gps.skyview[sat].azimuth;
|
||||
skyviewSet.elevation.value[sat] = gps.skyview[sat].elevation;
|
||||
skyviewSet.signal2noise.value[sat] = gps.skyview[sat].ss;
|
||||
skyviewSet.used.value[sat] = gps.skyview[sat].used;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void GpsHyperionLinuxController::overwriteTimeIfNotSane(timeval time, bool validFix) {
|
||||
if (not timeInit and validFix) {
|
||||
if (not utility::timeSanityCheck()) {
|
||||
|
@ -54,9 +54,12 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
|
||||
ReturnValue_t handleGpsReadData();
|
||||
ReturnValue_t handleCoreTelemetry(bool modeIsSet);
|
||||
ReturnValue_t handleSkyviewTelemetry();
|
||||
|
||||
private:
|
||||
GpsPrimaryDataset gpsSet;
|
||||
SkyviewDataset skyviewSet;
|
||||
gps_data_t gps = {};
|
||||
bool enableHkSets = false;
|
||||
const char* currentClientBuf = nullptr;
|
||||
@ -81,7 +84,6 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
|
||||
} oneShotSwitches;
|
||||
|
||||
bool debugHyperionGps = false;
|
||||
int32_t noModeSetCntr = 0;
|
||||
|
||||
// Returns true if the function should be called again or false if other
|
||||
// controller handling can be done.
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
//#include "lwgps/lwgps.h"
|
||||
// #include "lwgps/lwgps.h"
|
||||
#include "test/TestTask.h"
|
||||
|
||||
class ScexUartReader;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 303 translations.
|
||||
* @brief Auto-generated event translation file. Contains 305 translations.
|
||||
* @details
|
||||
* Generated on: 2023-08-03 13:36:37
|
||||
* Generated on: 2023-09-07 15:38:20
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@ -100,6 +100,7 @@ const char *MEKF_RECOVERY_STRING = "MEKF_RECOVERY";
|
||||
const char *MEKF_AUTOMATIC_RESET_STRING = "MEKF_AUTOMATIC_RESET";
|
||||
const char *MEKF_INVALID_MODE_VIOLATION_STRING = "MEKF_INVALID_MODE_VIOLATION";
|
||||
const char *SAFE_MODE_CONTROLLER_FAILURE_STRING = "SAFE_MODE_CONTROLLER_FAILURE";
|
||||
const char *TLE_TOO_OLD_STRING = "TLE_TOO_OLD";
|
||||
const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT";
|
||||
const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED";
|
||||
const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
|
||||
@ -167,6 +168,7 @@ const char *PDEC_TRYING_RESET_NO_INIT_STRING = "PDEC_TRYING_RESET_NO_INIT";
|
||||
const char *PDEC_RESET_FAILED_STRING = "PDEC_RESET_FAILED";
|
||||
const char *OPEN_IRQ_FILE_FAILED_STRING = "OPEN_IRQ_FILE_FAILED";
|
||||
const char *PDEC_INIT_FAILED_STRING = "PDEC_INIT_FAILED";
|
||||
const char *PDEC_CONFIG_CORRUPTED_STRING = "PDEC_CONFIG_CORRUPTED";
|
||||
const char *IMAGE_UPLOAD_FAILED_STRING = "IMAGE_UPLOAD_FAILED";
|
||||
const char *IMAGE_DOWNLOAD_FAILED_STRING = "IMAGE_DOWNLOAD_FAILED";
|
||||
const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL";
|
||||
@ -501,6 +503,8 @@ const char *translateEvents(Event event) {
|
||||
return MEKF_INVALID_MODE_VIOLATION_STRING;
|
||||
case (11207):
|
||||
return SAFE_MODE_CONTROLLER_FAILURE_STRING;
|
||||
case (11208):
|
||||
return TLE_TOO_OLD_STRING;
|
||||
case (11300):
|
||||
return SWITCH_CMD_SENT_STRING;
|
||||
case (11301):
|
||||
@ -635,6 +639,8 @@ const char *translateEvents(Event event) {
|
||||
return OPEN_IRQ_FILE_FAILED_STRING;
|
||||
case (12414):
|
||||
return PDEC_INIT_FAILED_STRING;
|
||||
case (12415):
|
||||
return PDEC_CONFIG_CORRUPTED_STRING;
|
||||
case (12500):
|
||||
return IMAGE_UPLOAD_FAILED_STRING;
|
||||
case (12501):
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 175 translations.
|
||||
* Generated on: 2023-08-03 13:36:37
|
||||
* Generated on: 2023-09-07 15:38:20
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
|
@ -22,11 +22,11 @@ ReturnValue_t PdecConfig::write() {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeFrameHeaderFirstOctet();
|
||||
result = writeFrameHeaderFirstWord();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeFrameHeaderSecondOctet();
|
||||
result = writeFrameHeaderSecondWord();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
@ -77,7 +77,7 @@ ReturnValue_t PdecConfig::setPositiveWindow(uint8_t pw) {
|
||||
return result;
|
||||
}
|
||||
// Rewrite second config word which contains the positive window parameter
|
||||
writeFrameHeaderSecondOctet();
|
||||
writeFrameHeaderSecondWord();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ ReturnValue_t PdecConfig::setNegativeWindow(uint8_t nw) {
|
||||
return result;
|
||||
}
|
||||
// Rewrite second config word which contains the negative window parameter
|
||||
writeFrameHeaderSecondOctet();
|
||||
writeFrameHeaderSecondWord();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -114,43 +114,23 @@ ReturnValue_t PdecConfig::getNegativeWindow(uint8_t& negativeWindow) {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecConfig::writeFrameHeaderFirstOctet() {
|
||||
ReturnValue_t PdecConfig::writeFrameHeaderFirstWord() {
|
||||
uint32_t word = 0;
|
||||
word |= (VERSION_ID << 30);
|
||||
|
||||
// Setting the bypass flag and the control command flag should not have any
|
||||
// implication on the operation of the PDEC IP Core
|
||||
word |= (BYPASS_FLAG << 29);
|
||||
word |= (CONTROL_COMMAND_FLAG << 28);
|
||||
|
||||
word |= (RESERVED_FIELD_A << 26);
|
||||
word |= (SPACECRAFT_ID << 16);
|
||||
word |= (VIRTUAL_CHANNEL << 10);
|
||||
word |= (DUMMY_BITS << 8);
|
||||
uint8_t positiveWindow = 0;
|
||||
ReturnValue_t result =
|
||||
localParameterHandler.getValue(pdecconfigdefs::paramkeys::POSITIVE_WINDOW, positiveWindow);
|
||||
ReturnValue_t result = createFirstWord(&word);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
word |= static_cast<uint32_t>(positiveWindow);
|
||||
*(memoryBaseAddress + FRAME_HEADER_OFFSET) = word;
|
||||
*(memoryBaseAddress + FRAME_HEADER_OFFSET + OFFSET_FIRST_CONFIG_WORD) = word;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecConfig::writeFrameHeaderSecondOctet() {
|
||||
uint8_t negativeWindow = 0;
|
||||
ReturnValue_t result =
|
||||
localParameterHandler.getValue(pdecconfigdefs::paramkeys::NEGATIVE_WINDOW, negativeWindow);
|
||||
ReturnValue_t PdecConfig::writeFrameHeaderSecondWord() {
|
||||
uint32_t word = 0;
|
||||
ReturnValue_t result = createSecondWord(&word);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
uint32_t word = 0;
|
||||
word = 0;
|
||||
word |= (static_cast<uint32_t>(negativeWindow) << 24);
|
||||
word |= (HIGH_AU_MAP_ID << 16);
|
||||
word |= (ENABLE_DERANDOMIZER << 8);
|
||||
*(memoryBaseAddress + FRAME_HEADER_OFFSET + 1) = word;
|
||||
*(memoryBaseAddress + FRAME_HEADER_OFFSET + OFFSET_SECOND_CONFIG_WORD) = word;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -189,3 +169,49 @@ uint8_t PdecConfig::getOddParity(uint8_t number) {
|
||||
parityBit = ~(countBits & 0x1) & 0x1;
|
||||
return parityBit;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecConfig::createFirstWord(uint32_t* word) {
|
||||
*word = 0;
|
||||
*word |= (VERSION_ID << 30);
|
||||
|
||||
// Setting the bypass flag and the control command flag should not have any
|
||||
// implication on the operation of the PDEC IP Core
|
||||
*word |= (BYPASS_FLAG << 29);
|
||||
*word |= (CONTROL_COMMAND_FLAG << 28);
|
||||
|
||||
*word |= (RESERVED_FIELD_A << 26);
|
||||
*word |= (SPACECRAFT_ID << 16);
|
||||
*word |= (VIRTUAL_CHANNEL << 10);
|
||||
*word |= (DUMMY_BITS << 8);
|
||||
uint8_t positiveWindow = 0;
|
||||
ReturnValue_t result =
|
||||
localParameterHandler.getValue(pdecconfigdefs::paramkeys::POSITIVE_WINDOW, positiveWindow);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
*word |= static_cast<uint32_t>(positiveWindow);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecConfig::createSecondWord(uint32_t* word) {
|
||||
uint8_t negativeWindow = 0;
|
||||
ReturnValue_t result =
|
||||
localParameterHandler.getValue(pdecconfigdefs::paramkeys::NEGATIVE_WINDOW, negativeWindow);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
*word = 0;
|
||||
*word = 0;
|
||||
*word |= (static_cast<uint32_t>(negativeWindow) << 24);
|
||||
*word |= (HIGH_AU_MAP_ID << 16);
|
||||
*word |= (ENABLE_DERANDOMIZER << 8);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
uint32_t PdecConfig::readbackFirstWord() {
|
||||
return *(memoryBaseAddress + FRAME_HEADER_OFFSET + OFFSET_FIRST_CONFIG_WORD);
|
||||
}
|
||||
|
||||
uint32_t PdecConfig::readbackSecondWord() {
|
||||
return *(memoryBaseAddress + FRAME_HEADER_OFFSET + OFFSET_SECOND_CONFIG_WORD);
|
||||
}
|
||||
|
@ -48,6 +48,39 @@ class PdecConfig {
|
||||
ReturnValue_t getPositiveWindow(uint8_t& positiveWindow);
|
||||
ReturnValue_t getNegativeWindow(uint8_t& negativeWindow);
|
||||
|
||||
/**
|
||||
* @brief Creates the first word of the PDEC configuration
|
||||
*
|
||||
* @param word The created word will be written to this pointer
|
||||
*
|
||||
* @return OK if successful, otherwise error return value
|
||||
*
|
||||
*/
|
||||
ReturnValue_t createFirstWord(uint32_t* word);
|
||||
|
||||
/**
|
||||
* @brief Creates the second word of the PDEC configuration
|
||||
*
|
||||
* @param word The created word will be written to this pointer
|
||||
*
|
||||
* @return OK if successful, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t createSecondWord(uint32_t* word);
|
||||
|
||||
/**
|
||||
* @brief Reads first config word from the config memory
|
||||
*
|
||||
* @return The config word
|
||||
*/
|
||||
uint32_t readbackFirstWord();
|
||||
|
||||
/**
|
||||
* @brief Reads the second config word from the config memory
|
||||
*
|
||||
* @return The config word
|
||||
*/
|
||||
uint32_t readbackSecondWord();
|
||||
|
||||
private:
|
||||
// TC transfer frame configuration parameters
|
||||
static const uint8_t VERSION_ID = 0;
|
||||
@ -66,6 +99,8 @@ class PdecConfig {
|
||||
|
||||
// 0x200 / 4 = 0x80
|
||||
static const uint32_t FRAME_HEADER_OFFSET = 0x80;
|
||||
static const uint32_t OFFSET_FIRST_CONFIG_WORD = 0;
|
||||
static const uint32_t OFFSET_SECOND_CONFIG_WORD = 1;
|
||||
|
||||
static const uint32_t MAP_ADDR_LUT_OFFSET = 0xA0;
|
||||
static const uint32_t MAP_CLK_FREQ_OFFSET = 0x90;
|
||||
@ -102,8 +137,8 @@ class PdecConfig {
|
||||
*/
|
||||
ReturnValue_t createPersistentConfig();
|
||||
|
||||
ReturnValue_t writeFrameHeaderFirstOctet();
|
||||
ReturnValue_t writeFrameHeaderSecondOctet();
|
||||
ReturnValue_t writeFrameHeaderFirstWord();
|
||||
ReturnValue_t writeFrameHeaderSecondWord();
|
||||
void writeMapConfig();
|
||||
|
||||
/**
|
||||
|
@ -478,6 +478,7 @@ bool PdecHandler::checkFrameAna(uint32_t pdecFar) {
|
||||
}
|
||||
case (FrameAna_t::FRAME_DIRTY): {
|
||||
triggerEvent(INVALID_TC_FRAME, FRAME_DIRTY_RETVAL);
|
||||
checkConfig();
|
||||
sif::warning << "PdecHandler::checkFrameAna: Frame dirty" << std::endl;
|
||||
break;
|
||||
}
|
||||
@ -577,6 +578,30 @@ void PdecHandler::handleIReason(uint32_t pdecFar, ReturnValue_t parameter1) {
|
||||
}
|
||||
}
|
||||
|
||||
void PdecHandler::checkConfig() {
|
||||
uint32_t firstWord = 0;
|
||||
ReturnValue_t result = pdecConfig.createFirstWord(&firstWord);
|
||||
if (result != returnvalue::OK) {
|
||||
// This should normally never happen during runtime. So here is just
|
||||
// output a warning
|
||||
sif::warning << "PdecHandler::checkConfig: Failed to create first word" << std::endl;
|
||||
return;
|
||||
}
|
||||
uint32_t secondWord = 0;
|
||||
result = pdecConfig.createSecondWord(&secondWord);
|
||||
if (result != returnvalue::OK) {
|
||||
// This should normally never happen during runtime. So here is just
|
||||
// output a warning
|
||||
sif::warning << "PdecHandler::checkConfig: Failed to create second word" << std::endl;
|
||||
return;
|
||||
}
|
||||
uint32_t readbackFirstWord = pdecConfig.readbackFirstWord();
|
||||
uint32_t readbackSecondWord = pdecConfig.readbackSecondWord();
|
||||
if (firstWord != readbackFirstWord or secondWord != readbackSecondWord) {
|
||||
triggerEvent(PDEC_CONFIG_CORRUPTED, readbackFirstWord, readbackSecondWord);
|
||||
}
|
||||
}
|
||||
|
||||
void PdecHandler::handleNewTc() {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
|
||||
|
@ -282,6 +282,11 @@ class PdecHandler : public SystemObject,
|
||||
*/
|
||||
void handleIReason(uint32_t pdecFar, ReturnValue_t parameter1);
|
||||
|
||||
/**
|
||||
* @brief Checks if PDEC configuration is still correct
|
||||
*/
|
||||
void checkConfig();
|
||||
|
||||
/**
|
||||
* @brief Handles the reception of new TCs. Reads the pointer to the storage location of the
|
||||
* new TC segment, extracts the PUS packet and forwards the data to the object
|
||||
|
@ -71,6 +71,10 @@ static constexpr Event OPEN_IRQ_FILE_FAILED = event::makeEvent(SUBSYSTEM_ID, 13,
|
||||
//! [EXPORT] : [COMMENT] PDEC initialization failed. This might also be due to the persistent
|
||||
//! confiuration never becoming available, for example due to SD card issues.
|
||||
static constexpr Event PDEC_INIT_FAILED = event::makeEvent(SUBSYSTEM_ID, 14, severity::HIGH);
|
||||
//! [EXPORT] : [COMMENT] The PDEC configuration area has been corrupted
|
||||
//! P1: The first configuration word
|
||||
//! P2: The second configuration word
|
||||
static constexpr Event PDEC_CONFIG_CORRUPTED = event::makeEvent(SUBSYSTEM_ID, 15, severity::HIGH);
|
||||
|
||||
// Action IDs
|
||||
static constexpr ActionId_t PRINT_CLCW = 0;
|
||||
|
@ -155,12 +155,15 @@ void PlocSupervisorHandler::doStartUp() {
|
||||
startupState = StartupState::ON;
|
||||
}
|
||||
if (startupState == StartupState::ON) {
|
||||
hkset.setReportingEnabled(true);
|
||||
setMode(_MODE_TO_ON);
|
||||
}
|
||||
}
|
||||
|
||||
void PlocSupervisorHandler::doShutDown() {
|
||||
setMode(_MODE_POWER_DOWN);
|
||||
hkset.setReportingEnabled(false);
|
||||
hkset.setValidity(false, true);
|
||||
shutdownCmdSent = false;
|
||||
packetInBuffer = false;
|
||||
nextReplyId = supv::NONE;
|
||||
@ -170,6 +173,10 @@ void PlocSupervisorHandler::doShutDown() {
|
||||
}
|
||||
|
||||
ReturnValue_t PlocSupervisorHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||
if (not commandIsExecuting(GET_HK_REPORT)) {
|
||||
*id = GET_HK_REPORT;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
|
||||
@ -430,7 +437,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() {
|
||||
insertInReplyMap(MEMORY_CHECK, 5, nullptr, 0, false);
|
||||
|
||||
// TM replies
|
||||
insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT);
|
||||
insertInReplyMap(HK_REPORT, 3, &hkset);
|
||||
insertInReplyMap(BOOT_STATUS_REPORT, 3, &bootStatusReport, SIZE_BOOT_STATUS_REPORT);
|
||||
insertInReplyMap(LATCHUP_REPORT, 3, &latchupStatusReport, SIZE_LATCHUP_STATUS_REPORT);
|
||||
insertInReplyMap(LOGGING_REPORT, 3, &loggingReport, SIZE_LOGGING_REPORT);
|
||||
@ -790,6 +797,8 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool
|
||||
localDataPoolMap.emplace(supv::ADC_ENG_14, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(supv::ADC_ENG_15, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
poolManager.subscribeForRegularPeriodicPacket(
|
||||
subdp::RegularHkPeriodicParams(hkset.getSid(), false, 10.0));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
@ -918,7 +927,7 @@ ReturnValue_t PlocSupervisorHandler::handleExecutionReport(const uint8_t* data)
|
||||
ReturnValue_t PlocSupervisorHandler::handleHkReport(const uint8_t* data) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
|
||||
result = verifyPacket(data, supv::SIZE_HK_REPORT);
|
||||
result = verifyPacket(data, tmReader.getFullPacketLen());
|
||||
|
||||
if (result == result::CRC_FAILURE) {
|
||||
sif::error << "PlocSupervisorHandler::handleHkReport: Hk report has invalid crc" << std::endl;
|
||||
@ -2096,9 +2105,9 @@ uint32_t PlocSupervisorHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t mod
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
//#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||
// #if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1
|
||||
// loggingReport.printSet();
|
||||
//#endif
|
||||
// #endif
|
||||
// nextReplyId = supv::EXE_REPORT;
|
||||
// return result;
|
||||
// }
|
||||
|
@ -274,12 +274,12 @@ ReturnValue_t PlocSupvUartManager::initiateUpdateContinuation() {
|
||||
}
|
||||
|
||||
// ReturnValue_t PlocSupvHelper::startEventBufferRequest(std::string path) {
|
||||
//#ifdef XIPHOS_Q7S
|
||||
// #ifdef XIPHOS_Q7S
|
||||
// ReturnValue_t result = FilesystemHelper::checkPath(path);
|
||||
// if (result != returnvalue::OK) {
|
||||
// return result;
|
||||
// }
|
||||
//#endif
|
||||
// #endif
|
||||
// if (not std::filesystem::exists(path)) {
|
||||
// return PATH_NOT_EXISTS;
|
||||
// }
|
||||
@ -836,11 +836,11 @@ uint32_t PlocSupvUartManager::getFileSize(std::string filename) {
|
||||
ReturnValue_t PlocSupvUartManager::handleEventBufferReception(ploc::SpTmReader& reader) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
// TODO: Fix
|
||||
//#ifdef XIPHOS_Q7S
|
||||
// #ifdef XIPHOS_Q7S
|
||||
// if (not sdcMan->getActiveSdCard()) {
|
||||
// return HasFileSystemIF::FILESYSTEM_INACTIVE;
|
||||
// }
|
||||
//#endif
|
||||
// #endif
|
||||
// std::string filename = Filenaming::generateAbsoluteFilename(
|
||||
// eventBufferReq.path, eventBufferReq.filename, timestamping);
|
||||
// std::ofstream file(filename, std::ios_base::app | std::ios_base::out);
|
||||
|
@ -139,7 +139,6 @@ enum ReplyId : DeviceCommandId_t {
|
||||
// Size of complete space packet (6 byte header + size of data + 2 byte CRC)
|
||||
static const uint16_t SIZE_ACK_REPORT = 14;
|
||||
static const uint16_t SIZE_EXE_REPORT = 14;
|
||||
static const uint16_t SIZE_HK_REPORT = 52;
|
||||
static const uint16_t SIZE_BOOT_STATUS_REPORT = 24;
|
||||
static const uint16_t SIZE_LATCHUP_STATUS_REPORT = 31;
|
||||
static const uint16_t SIZE_LOGGING_REPORT = 73;
|
||||
|
Reference in New Issue
Block a user