Merge remote-tracking branch 'origin/develop' into mueller/pl-ss
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
commit
5b0f1efefd
@ -15,6 +15,8 @@ list yields a list of all related PRs for each release.
|
||||
## Added
|
||||
|
||||
- ACS Subsystem. PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/231
|
||||
- PUS11 TC scheduler
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/259
|
||||
- Regular reboot command
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/242
|
||||
- Commands for individual RTD devices
|
||||
@ -32,6 +34,11 @@ list yields a list of all related PRs for each release.
|
||||
username appended at the end is created as a side-product now
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/248
|
||||
|
||||
## Fixed
|
||||
|
||||
- `q7s-cp.py` bugfix
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/256
|
||||
|
||||
### Heater
|
||||
|
||||
- Adds `HealthIF` to heaters. Heaters are own system object with queues now which allows to set them faulty.
|
||||
|
@ -64,6 +64,8 @@ include(EiveHelpers)
|
||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||
|
||||
set(OBSW_MAX_SCHEDULED_TCS 500)
|
||||
|
||||
if(EIVE_Q7S_EM)
|
||||
set(OBSW_Q7S_EM
|
||||
1
|
||||
|
@ -1,18 +0,0 @@
|
||||
#ifndef FSFWCONFIG_TMTC_APID_H_
|
||||
#define FSFWCONFIG_TMTC_APID_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Application Process Definition: entity, uniquely identified by an
|
||||
* application process ID (APID), capable of generating telemetry source
|
||||
* packets and receiving telecommand packets
|
||||
*
|
||||
* SOURCE APID: 0x73 / 115 / s
|
||||
* APID is a 11 bit number
|
||||
*/
|
||||
namespace apid {
|
||||
static const uint16_t EIVE_OBSW = 0x65;
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
@ -1,9 +1,14 @@
|
||||
#include "gnssCallback.h"
|
||||
|
||||
#include "fsfw/action/HasActionsIF.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||
ReturnValue_t gps::triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args) {
|
||||
// At least one byte which denotes which GPS to reset is required
|
||||
if(len < 1 or actionData == nullptr) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
|
||||
if (args == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
@ -12,11 +17,10 @@ ReturnValue_t gps::triggerGpioResetPin(void* args) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
gpioId_t gpioId;
|
||||
if (resetArgs->gnss1) {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
|
||||
} else {
|
||||
if (actionData[0] == 0) {
|
||||
gpioId = gpioIds::GNSS_0_NRESET;
|
||||
} else {
|
||||
gpioId = gpioIds::GNSS_1_NRESET;
|
||||
}
|
||||
resetArgs->gpioComIF->pullLow(gpioId);
|
||||
TaskFactory::delayTask(resetArgs->waitPeriodMs);
|
||||
|
@ -5,14 +5,13 @@
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
|
||||
struct ResetArgs {
|
||||
bool gnss1 = false;
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
uint32_t waitPeriodMs = 100;
|
||||
};
|
||||
|
||||
namespace gps {
|
||||
|
||||
ReturnValue_t triggerGpioResetPin(void* args);
|
||||
ReturnValue_t triggerGpioResetPin(const uint8_t* actionData, size_t len, void* args);
|
||||
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@ CoreController::CoreController(object_id_t objectId)
|
||||
} catch (const std::filesystem::filesystem_error &e) {
|
||||
sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl;
|
||||
}
|
||||
sdCardCheckCd.timeOut();
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(5, EventMessage::MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
@ -77,6 +78,10 @@ void CoreController::performControlOperation() {
|
||||
performWatchdogControlOperation();
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
if (sdCardCheckCd.hasTimedOut()) {
|
||||
performSdCardCheck();
|
||||
sdCardCheckCd.resetTimer();
|
||||
}
|
||||
readHkData();
|
||||
opDivider5.checkAndIncrement();
|
||||
opDivider10.checkAndIncrement();
|
||||
@ -134,6 +139,9 @@ ReturnValue_t CoreController::initialize() {
|
||||
|
||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
sdcMan->setActiveSdCard(sdInfo.pref);
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (BLOCKING_SD_INIT) {
|
||||
ReturnValue_t result = initSdCardBlocking();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK and result != SdCardManager::ALREADY_MOUNTED) {
|
||||
@ -165,7 +173,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (data[0] == 0) {
|
||||
@ -205,7 +213,7 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
rebootFile.maxCount = data[0];
|
||||
@ -242,13 +250,12 @@ ReturnValue_t CoreController::initSdCardBlocking() {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
#else
|
||||
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Getting SD card activity status failed" << std::endl;
|
||||
}
|
||||
|
||||
#if Q7S_SD_CARD_CONFIG == Q7S_SD_COLD_REDUNDANT
|
||||
determinePreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
sif::info << "Cold redundant SD card configuration, preferred SD card: "
|
||||
<< static_cast<int>(sdInfo.pref) << std::endl;
|
||||
@ -329,8 +336,8 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
|
||||
if (sdInfo.state == SdStates::SET_STATE_SELF) {
|
||||
if (not sdInfo.commandExecuted) {
|
||||
result = sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
determinePreferredSdCard();
|
||||
result = sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
sdInfo.pref = sdcMan->getPreferredSdCard();
|
||||
updateSdInfoOther();
|
||||
if (sdInfo.pref != sd::SdCard::SLOT_0 and sdInfo.pref != sd::SdCard::SLOT_1) {
|
||||
sif::warning << "Preferred SD card invalid. Setting to card 0.." << std::endl;
|
||||
@ -473,7 +480,7 @@ ReturnValue_t CoreController::sdStateMachine() {
|
||||
sdInfo.state = SdStates::IDLE;
|
||||
sdInfo.cycleCount = 0;
|
||||
sdcMan->setBlocking(false);
|
||||
sdcMan->getSdCardActiveStatus(sdInfo.currentState);
|
||||
sdcMan->getSdCardsStatus(sdInfo.currentState);
|
||||
if (not sdInfo.initFinished) {
|
||||
updateSdInfoOther();
|
||||
sdInfo.initFinished = true;
|
||||
@ -951,25 +958,6 @@ ReturnValue_t CoreController::gracefulShutdownTasks(xsc::Chip chip, xsc::Copy co
|
||||
|
||||
CoreController::~CoreController() {}
|
||||
|
||||
void CoreController::determinePreferredSdCard() {
|
||||
if (sdInfo.pref == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(sdInfo.pref);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == scratch::KEY_NOT_FOUND) {
|
||||
sif::warning << "CoreController::sdCardInit: "
|
||||
"Preferred SD card not set. Setting to 0"
|
||||
<< std::endl;
|
||||
sdcMan->setPreferredSdCard(sd::SdCard::SLOT_0);
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
} else {
|
||||
sif::warning << "CoreController::sdCardInit: Could not get preferred SD card"
|
||||
"information from the scratch buffer"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CoreController::updateSdInfoOther() {
|
||||
if (sdInfo.pref == sd::SdCard::SLOT_0) {
|
||||
sdInfo.prefChar = "0";
|
||||
@ -1253,24 +1241,73 @@ void CoreController::performWatchdogControlOperation() {
|
||||
}
|
||||
|
||||
void CoreController::performMountedSdCardOperations() {
|
||||
currMntPrefix = sdcMan->getCurrentMountPrefix();
|
||||
if (doPerformMountedSdCardOps) {
|
||||
bool sdCardMounted = false;
|
||||
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref);
|
||||
if (sdCardMounted) {
|
||||
std::string path = currMntPrefix + "/" + CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path)) {
|
||||
std::filesystem::create_directory(path);
|
||||
auto mountedSdCardOp = [&](bool &mntSwitch, sd::SdCard sdCard, std::string mntPoint) {
|
||||
if (mntSwitch) {
|
||||
bool sdCardMounted = sdcMan->isSdCardMounted(sdCard);
|
||||
if (sdCardMounted and not performOneShotSdCardOpsSwitch) {
|
||||
std::ostringstream path;
|
||||
path << mntPoint << "/" << CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path.str())) {
|
||||
std::filesystem::create_directory(path.str());
|
||||
}
|
||||
initVersionFile();
|
||||
initClockFromTimeFile();
|
||||
performRebootFileHandling(false);
|
||||
performOneShotSdCardOpsSwitch = true;
|
||||
}
|
||||
initVersionFile();
|
||||
initClockFromTimeFile();
|
||||
performRebootFileHandling(false);
|
||||
doPerformMountedSdCardOps = false;
|
||||
mntSwitch = false;
|
||||
}
|
||||
};
|
||||
if (sdInfo.pref == sd::SdCard::SLOT_1) {
|
||||
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
|
||||
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
|
||||
} else {
|
||||
mountedSdCardOp(sdInfo.mountSwitch.first, sd::SdCard::SLOT_0, SdCardManager::SD_0_MOUNT_POINT);
|
||||
mountedSdCardOp(sdInfo.mountSwitch.second, sd::SdCard::SLOT_1, SdCardManager::SD_1_MOUNT_POINT);
|
||||
}
|
||||
timeFileHandler();
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::performSdCardCheck() {
|
||||
bool mountedReadOnly = false;
|
||||
SdCardManager::SdStatePair active;
|
||||
sdcMan->getSdCardsStatus(active);
|
||||
auto sdCardCheck = [&](sd::SdCard sdCard) {
|
||||
ReturnValue_t result = sdcMan->isSdCardMountedReadOnly(sdCard, mountedReadOnly);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: Could not check "
|
||||
"read-only mount state"
|
||||
<< std::endl;
|
||||
mountedReadOnly = true;
|
||||
}
|
||||
if (mountedReadOnly) {
|
||||
int linuxErrno = 0;
|
||||
result = sdcMan->performFsck(sdCard, true, linuxErrno);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "CoreController::performSdCardCheck: fsck command on SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " failed with code " << linuxErrno << " | "
|
||||
<< strerror(linuxErrno);
|
||||
}
|
||||
result = sdcMan->remountReadWrite(sdCard);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::performSdCardCheck: Remounted SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " read-write";
|
||||
} else {
|
||||
sif::error << "CoreController::performSdCardCheck: Remounting SD Card "
|
||||
<< static_cast<uint8_t>(sdCard) << " read-write failed";
|
||||
}
|
||||
}
|
||||
};
|
||||
if (active.first == sd::SdState::MOUNTED) {
|
||||
sdCardCheck(sd::SdCard::SLOT_0);
|
||||
}
|
||||
if (active.second == sd::SdState::MOUNTED) {
|
||||
sdCardCheck(sd::SdCard::SLOT_1);
|
||||
}
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void CoreController::performRebootFileHandling(bool recreateFile) {
|
||||
using namespace std;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
@ -1696,7 +1733,7 @@ void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
}
|
||||
|
||||
void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::string path = currMntPrefix + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::CHIP_0) {
|
||||
|
@ -162,11 +162,12 @@ class CoreController : public ExtendedControllerBase {
|
||||
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdCard other = sd::SdCard::NONE;
|
||||
sd::SdState prefState = sd::SdState::OFF;
|
||||
sd::SdState otherState = sd::SdState::OFF;
|
||||
std::string prefChar = "0";
|
||||
std::string otherChar = "1";
|
||||
std::pair<bool, bool> mountSwitch = {true, true};
|
||||
SdStates state = SdStates::START;
|
||||
// Used to track whether a command was executed
|
||||
bool commandExecuted = true;
|
||||
@ -182,7 +183,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
} sdInfo;
|
||||
RebootFile rebootFile = {};
|
||||
std::string currMntPrefix;
|
||||
bool doPerformMountedSdCardOps = true;
|
||||
bool performOneShotSdCardOpsSwitch = true;
|
||||
|
||||
/**
|
||||
* Index 0: Chip 0 Copy 0
|
||||
@ -198,12 +199,14 @@ class CoreController : public ExtendedControllerBase {
|
||||
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
Countdown sdCardCheckCd = Countdown(120000);
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
||||
void performMountedSdCardOperations();
|
||||
ReturnValue_t initVersionFile();
|
||||
|
||||
ReturnValue_t initClockFromTimeFile();
|
||||
ReturnValue_t performSdCardCheck();
|
||||
ReturnValue_t timeFileHandler();
|
||||
ReturnValue_t initBootCopy();
|
||||
ReturnValue_t initWatchdogFifo();
|
||||
@ -217,7 +220,6 @@ class CoreController : public ExtendedControllerBase {
|
||||
ReturnValue_t sdColdRedundantBlockingInit();
|
||||
|
||||
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
|
||||
void determinePreferredSdCard();
|
||||
void executeNextExternalSdCommand();
|
||||
void checkExternalSdCommandStatus();
|
||||
void performRebootFileHandling(bool recreateFile);
|
||||
|
@ -429,13 +429,22 @@ void initmission::createPusTasks(TaskFactory& factory,
|
||||
|
||||
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
initmission::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
@ -445,10 +454,6 @@ void initmission::createPusTasks(TaskFactory& factory,
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
taskVec.push_back(pusMedPrio);
|
||||
|
||||
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
|
||||
|
@ -93,8 +93,7 @@
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
|
||||
ResetArgs resetArgsGnss0;
|
||||
ResetArgs resetArgsGnss1;
|
||||
ResetArgs RESET_ARGS_GNSS;
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
@ -462,15 +461,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
||||
#if OBSW_DEBUG_GPS == 1
|
||||
debugGps = true;
|
||||
#endif
|
||||
resetArgsGnss1.gnss1 = true;
|
||||
resetArgsGnss1.gpioComIF = gpioComIF;
|
||||
resetArgsGnss1.waitPeriodMs = 100;
|
||||
resetArgsGnss0.gnss1 = false;
|
||||
resetArgsGnss0.gpioComIF = gpioComIF;
|
||||
resetArgsGnss0.waitPeriodMs = 100;
|
||||
auto gpsHandler0 =
|
||||
RESET_ARGS_GNSS.gpioComIF = gpioComIF;
|
||||
RESET_ARGS_GNSS.waitPeriodMs = 100;
|
||||
auto gpsCtrl =
|
||||
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
||||
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
||||
gpsCtrl->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS);
|
||||
|
||||
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
||||
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
||||
|
@ -70,9 +70,8 @@ void FileSystemHandler::fileSystemHandlerLoop() {
|
||||
|
||||
void FileSystemHandler::fileSystemCheckup() {
|
||||
SdCardManager::SdStatePair statusPair;
|
||||
sdcMan->getSdCardActiveStatus(statusPair);
|
||||
sd::SdCard preferredSdCard;
|
||||
sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
sdcMan->getSdCardsStatus(statusPair);
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if ((preferredSdCard == sd::SdCard::SLOT_0) and (statusPair.first == sd::SdState::MOUNTED)) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if ((preferredSdCard == sd::SdCard::SLOT_1) and
|
||||
@ -109,11 +108,7 @@ ReturnValue_t FileSystemHandler::initialize() {
|
||||
<< std::endl;
|
||||
}
|
||||
sdcMan = SdCardManager::instance();
|
||||
sd::SdCard preferredSdCard;
|
||||
ReturnValue_t result = sdcMan->getPreferredSdCard(preferredSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
sd::SdCard preferredSdCard = sdcMan->getPreferredSdCard();
|
||||
if (preferredSdCard == sd::SdCard::SLOT_0) {
|
||||
currentMountPrefix = SdCardManager::SD_0_MOUNT_POINT;
|
||||
} else if (preferredSdCard == sd::SdCard::SLOT_1) {
|
||||
|
@ -16,23 +16,44 @@
|
||||
#include "linux/utility/utility.h"
|
||||
#include "scratchApi.h"
|
||||
|
||||
SdCardManager* SdCardManager::factoryInstance = nullptr;
|
||||
SdCardManager* SdCardManager::INSTANCE = nullptr;
|
||||
|
||||
SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
MutexGuard mg(mutex);
|
||||
uint8_t prefSdRaw = 0;
|
||||
ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdRaw);
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == scratch::KEY_NOT_FOUND) {
|
||||
sif::warning << "CoreController::sdCardInit: "
|
||||
"Preferred SD card not set. Setting to 0"
|
||||
<< std::endl;
|
||||
setPreferredSdCard(sd::SdCard::SLOT_0);
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
} else {
|
||||
// Should not happen.
|
||||
// TODO: Maybe trigger event?
|
||||
sif::error << "SdCardManager::SdCardManager: Reading preferred SD card from scratch"
|
||||
"buffer failed"
|
||||
<< std::endl;
|
||||
sdInfo.pref = sd::SdCard::SLOT_0;
|
||||
}
|
||||
}
|
||||
sdInfo.pref = static_cast<sd::SdCard>(prefSdRaw);
|
||||
}
|
||||
|
||||
SdCardManager::~SdCardManager() {}
|
||||
|
||||
void SdCardManager::create() {
|
||||
if (factoryInstance == nullptr) {
|
||||
factoryInstance = new SdCardManager();
|
||||
if (INSTANCE == nullptr) {
|
||||
INSTANCE = new SdCardManager();
|
||||
}
|
||||
}
|
||||
|
||||
SdCardManager* SdCardManager::instance() {
|
||||
SdCardManager::create();
|
||||
return SdCardManager::factoryInstance;
|
||||
return SdCardManager::INSTANCE;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCard,
|
||||
@ -51,7 +72,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
result = getSdCardActiveStatus(*statusPair);
|
||||
result = getSdCardsStatus(*statusPair);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -98,7 +119,7 @@ ReturnValue_t SdCardManager::switchOnSdCard(sd::SdCard sdCard, bool doMountSdCar
|
||||
ReturnValue_t SdCardManager::switchOffSdCard(sd::SdCard sdCard, bool doUnmountSdCard,
|
||||
SdStatePair* statusPair) {
|
||||
std::pair<sd::SdState, sd::SdState> active;
|
||||
ReturnValue_t result = getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = getSdCardsStatus(active);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
@ -165,7 +186,7 @@ ReturnValue_t SdCardManager::setSdCardState(sd::SdCard sdCard, bool on) {
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getSdCardActiveStatus(SdStatePair& active) {
|
||||
ReturnValue_t SdCardManager::getSdCardsStatus(SdStatePair& active) {
|
||||
using namespace std;
|
||||
MutexGuard mg(mutex);
|
||||
if (not filesystem::exists(SD_STATE_FILE)) {
|
||||
@ -273,14 +294,14 @@ ReturnValue_t SdCardManager::sanitizeState(SdStatePair* statusPair, sd::SdCard p
|
||||
resetNonBlockingState = true;
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
result = getPreferredSdCard(prefSdCard);
|
||||
result = getPreferredSdCard();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
}
|
||||
}
|
||||
if (statusPair == nullptr) {
|
||||
sdStatusPtr = std::make_unique<SdStatePair>();
|
||||
statusPair = sdStatusPtr.get();
|
||||
getSdCardActiveStatus(*statusPair);
|
||||
getSdCardsStatus(*statusPair);
|
||||
}
|
||||
|
||||
if (statusPair->first == sd::SdState::ON) {
|
||||
@ -351,20 +372,21 @@ void SdCardManager::processSdStatusLine(std::pair<sd::SdState, sd::SdState>& act
|
||||
idx++;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::getPreferredSdCard(sd::SdCard& sdCard) const {
|
||||
uint8_t prefSdCard = 0;
|
||||
ReturnValue_t result = scratch::readNumber(scratch::PREFERED_SDC_KEY, prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
sd::SdCard SdCardManager::getPreferredSdCard() const {
|
||||
MutexGuard mg(mutex);
|
||||
auto res = mg.getLockResult();
|
||||
if (res != RETURN_OK) {
|
||||
sif::error << "SdCardManager::getPreferredSdCard: Lock error" << std::endl;
|
||||
}
|
||||
sdCard = static_cast<sd::SdCard>(prefSdCard);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return sdInfo.pref;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::setPreferredSdCard(sd::SdCard sdCard) {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdCard == sd::SdCard::BOTH) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
sdInfo.pref = sdCard;
|
||||
return scratch::writeNumber(scratch::PREFERED_SDC_KEY, static_cast<uint8_t>(sdCard));
|
||||
}
|
||||
|
||||
@ -383,14 +405,9 @@ ReturnValue_t SdCardManager::updateSdCardStateFile() {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string SdCardManager::getCurrentMountPrefix(sd::SdCard prefSdCard) {
|
||||
if (prefSdCard == sd::SdCard::NONE) {
|
||||
ReturnValue_t result = getPreferredSdCard(prefSdCard);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
}
|
||||
}
|
||||
if (prefSdCard == sd::SdCard::SLOT_0) {
|
||||
std::string SdCardManager::getCurrentMountPrefix() const {
|
||||
MutexGuard mg(mutex);
|
||||
if (sdInfo.active == sd::SdCard::SLOT_0) {
|
||||
return SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
return SD_1_MOUNT_POINT;
|
||||
@ -443,7 +460,7 @@ void SdCardManager::setPrintCommandOutput(bool print) { this->printCmdOutput = p
|
||||
|
||||
bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
SdCardManager::SdStatePair active;
|
||||
ReturnValue_t result = this->getSdCardActiveStatus(active);
|
||||
ReturnValue_t result = this->getSdCardsStatus(active);
|
||||
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "SdCardManager::isSdCardMounted: Failed to get SD card active state";
|
||||
@ -466,3 +483,68 @@ bool SdCardManager::isSdCardMounted(sd::SdCard sdCard) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "grep -q '" << SD_0_MOUNT_POINT << " vfat ro,' /proc/mounts";
|
||||
} else {
|
||||
command << "grep -q '" << SD_1_MOUNT_POINT << " vfat ro,' /proc/mounts";
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = cmdExecutor.execute();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
int exitStatus = cmdExecutor.getLastError();
|
||||
if (exitStatus == 1) {
|
||||
readOnly = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
auto& readVec = cmdExecutor.getReadVector();
|
||||
size_t readLen = strnlen(readVec.data(), readVec.size());
|
||||
if (readLen == 0) {
|
||||
readOnly = false;
|
||||
}
|
||||
readOnly = true;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::remountReadWrite(sd::SdCard sdcard) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "mount -o remount,rw " << SD_0_DEV_NAME << " " << SD_0_MOUNT_POINT;
|
||||
} else {
|
||||
command << "mount -o remount,rw " << SD_1_DEV_NAME << " " << SD_1_MOUNT_POINT;
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, false);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return cmdExecutor.execute();
|
||||
}
|
||||
|
||||
ReturnValue_t SdCardManager::performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError) {
|
||||
std::ostringstream command;
|
||||
if (sdcard == sd::SdCard::SLOT_0) {
|
||||
command << "fsck -y " << SD_0_DEV_NAME;
|
||||
} else {
|
||||
command << "fsck -y " << SD_1_DEV_NAME;
|
||||
}
|
||||
ReturnValue_t result = cmdExecutor.load(command.str(), true, printOutput);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = cmdExecutor.execute();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
linuxError = cmdExecutor.getLastError();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void SdCardManager::setActiveSdCard(sd::SdCard sdCard) { sdInfo.active = sdCard; }
|
||||
|
||||
sd::SdCard SdCardManager::getActiveSdCard() const { return sdInfo.active; }
|
||||
|
@ -24,7 +24,7 @@ class MutexIF;
|
||||
* @brief Manages handling of SD cards like switching them on or off or getting the current
|
||||
* state
|
||||
*/
|
||||
class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
class SdCardManager : public SystemObject, public HasReturnvaluesIF, public SdCardMountedIF {
|
||||
friend class SdCardAccess;
|
||||
|
||||
public:
|
||||
@ -36,6 +36,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
using SdStatePair = std::pair<sd::SdState, sd::SdState>;
|
||||
|
||||
struct SdInfo {
|
||||
sd::SdCard pref = sd::SdCard::NONE;
|
||||
sd::SdCard other = sd::SdCard::NONE;
|
||||
sd::SdCard active = sd::SdCard::NONE;
|
||||
} sdInfo;
|
||||
|
||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::SD_CARD_MANAGER;
|
||||
|
||||
static constexpr ReturnValue_t OP_ONGOING = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0);
|
||||
@ -91,7 +97,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param sdCard
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const override;
|
||||
sd::SdCard getPreferredSdCard() const override;
|
||||
|
||||
/**
|
||||
* Switch on the specified SD card.
|
||||
@ -138,7 +144,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* should call #updateSdCardStateFile again in that case
|
||||
* - STATUS_FILE_NEXISTS if the status file does not exist
|
||||
*/
|
||||
ReturnValue_t getSdCardActiveStatus(SdStatePair& active);
|
||||
ReturnValue_t getSdCardsStatus(SdStatePair& active);
|
||||
|
||||
/**
|
||||
* Mount the specified SD card. This is necessary to use it.
|
||||
@ -146,6 +152,20 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t mountSdCard(sd::SdCard sdCard);
|
||||
|
||||
/**
|
||||
* Set the currently active SD card. This does not necessarily mean that the SD card is on or
|
||||
* mounted
|
||||
* @param sdCard
|
||||
*/
|
||||
void setActiveSdCard(sd::SdCard sdCard) override;
|
||||
/**
|
||||
* Get the currently active SD card. This does not necessarily mean that the SD card is on or
|
||||
* mounted
|
||||
* @return
|
||||
*/
|
||||
sd::SdCard getActiveSdCard() const override;
|
||||
|
||||
/**
|
||||
* Unmount the specified SD card. This is recommended before switching it off. The SD card
|
||||
* can't be used after it has been unmounted.
|
||||
@ -173,7 +193,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
* @param prefSdCardPtr
|
||||
* @return
|
||||
*/
|
||||
std::string getCurrentMountPrefix(sd::SdCard prefSdCardPtr = sd::SdCard::NONE) override;
|
||||
std::string getCurrentMountPrefix() const override;
|
||||
|
||||
OpStatus checkCurrentOp(Operations& currentOp);
|
||||
|
||||
@ -194,6 +214,12 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
*/
|
||||
bool isSdCardMounted(sd::SdCard sdCard) override;
|
||||
|
||||
ReturnValue_t isSdCardMountedReadOnly(sd::SdCard sdcard, bool& readOnly);
|
||||
|
||||
ReturnValue_t remountReadWrite(sd::SdCard sdcard);
|
||||
|
||||
ReturnValue_t performFsck(sd::SdCard sdcard, bool printOutput, int& linuxError);
|
||||
|
||||
private:
|
||||
CommandExecutor cmdExecutor;
|
||||
Operations currentOp = Operations::IDLE;
|
||||
@ -210,7 +236,7 @@ class SdCardManager : public SystemObject, public SdCardMountedIF {
|
||||
|
||||
std::string currentPrefix;
|
||||
|
||||
static SdCardManager* factoryInstance;
|
||||
static SdCardManager* INSTANCE;
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_ */
|
||||
|
@ -33,6 +33,9 @@ static constexpr uint8_t OBSW_VERSION_REVISION = @OBSW_VERSION_REVISION@;
|
||||
// CST: Commits since tag
|
||||
static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@";
|
||||
|
||||
|
||||
static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = @OBSW_MAX_SCHEDULED_TCS@;
|
||||
|
||||
extern const fsfw::Version OBSW_VERSION;
|
||||
|
||||
extern const uint16_t PUS_PACKET_ID;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||
#ifndef COMMON_CONFIG_TMTC_PUSIDS_H_
|
||||
#define COMMON_CONFIG_TMTC_PUSIDS_H_
|
||||
|
||||
namespace pus {
|
||||
enum Ids {
|
||||
@ -11,6 +11,7 @@ enum Ids {
|
||||
PUS_SERVICE_6 = 6,
|
||||
PUS_SERVICE_8 = 8,
|
||||
PUS_SERVICE_9 = 9,
|
||||
PUS_SERVICE_11 = 11,
|
||||
PUS_SERVICE_17 = 17,
|
||||
PUS_SERVICE_19 = 19,
|
||||
PUS_SERVICE_20 = 20,
|
||||
@ -20,4 +21,4 @@ enum Ids {
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
||||
#endif /* COMMON_CONFIG_TMTC_PUSIDS_H_ */
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit c8355251967009559ea790b63c3ebfc67a27efef
|
||||
Subproject commit 76a459a02c9374d3edcb5c52d5c71e94c69d2f0f
|
@ -57,12 +57,12 @@ ReturnValue_t GPSHyperionLinuxController::executeAction(ActionId_t actionId,
|
||||
MessageQueueId_t commandedBy,
|
||||
const uint8_t *data, size_t size) {
|
||||
switch (actionId) {
|
||||
case (GpsHyperion::TRIGGER_RESET_PIN): {
|
||||
case (GpsHyperion::TRIGGER_RESET_PIN_GNSS): {
|
||||
if (resetCallback != nullptr) {
|
||||
PoolReadGuard pg(&gpsSet);
|
||||
// Set HK entries invalid
|
||||
gpsSet.setValidity(false, true);
|
||||
resetCallback(resetCallbackArgs);
|
||||
resetCallback(data, size, resetCallbackArgs);
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
|
@ -30,7 +30,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
|
||||
bool debugHyperionGps = false);
|
||||
virtual ~GPSHyperionLinuxController();
|
||||
|
||||
using gpioResetFunction_t = ReturnValue_t (*)(void* args);
|
||||
using gpioResetFunction_t = ReturnValue_t (*)(const uint8_t* actionData, size_t len, void* args);
|
||||
|
||||
void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void* args);
|
||||
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
|
||||
|
@ -1,23 +0,0 @@
|
||||
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||
|
||||
namespace pus {
|
||||
enum Ids {
|
||||
PUS_SERVICE_1 = 1,
|
||||
PUS_SERVICE_2 = 2,
|
||||
PUS_SERVICE_3 = 3,
|
||||
PUS_SERVICE_3_PSB = 3,
|
||||
PUS_SERVICE_5 = 5,
|
||||
PUS_SERVICE_6 = 6,
|
||||
PUS_SERVICE_8 = 8,
|
||||
PUS_SERVICE_9 = 9,
|
||||
PUS_SERVICE_17 = 17,
|
||||
PUS_SERVICE_19 = 19,
|
||||
PUS_SERVICE_20 = 20,
|
||||
PUS_SERVICE_23 = 23,
|
||||
PUS_SERVICE_200 = 200,
|
||||
PUS_SERVICE_201 = 201,
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
@ -13,6 +13,7 @@
|
||||
#include <fsfw/pus/Service5EventReporting.h>
|
||||
#include <fsfw/pus/Service8FunctionManagement.h>
|
||||
#include <fsfw/pus/Service9TimeManagement.h>
|
||||
#include "fsfw/pus/Service11TelecommandScheduling.h"
|
||||
#include <fsfw/storagemanager/PoolManager.h>
|
||||
#include <fsfw/tcdistribution/CCSDSDistributor.h>
|
||||
#include <fsfw/tcdistribution/PUSDistributor.h>
|
||||
@ -73,7 +74,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
|
||||
new PoolManager(objects::IPC_STORE, poolCfg);
|
||||
}
|
||||
|
||||
new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
auto* ccsdsDistrib = new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR,
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
|
||||
@ -96,6 +97,9 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
|
||||
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_8, 3, 60);
|
||||
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9);
|
||||
|
||||
new Service11TelecommandScheduling<common::OBSW_MAX_SCHEDULED_TCS>(objects::PUS_SERVICE_11_TC_SCHEDULER,
|
||||
apid::EIVE_OBSW, pus::PUS_SERVICE_11, ccsdsDistrib);
|
||||
new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW, pus::PUS_SERVICE_17);
|
||||
new Service20ParameterManagement(objects::PUS_SERVICE_20_PARAMETERS, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_20);
|
||||
@ -120,6 +124,6 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) {
|
||||
tcpServer->enableWiretapping(true);
|
||||
#endif /* OBSW_TCP_SERVER_WIRETAPPING == 1 */
|
||||
#endif /* OBSW_USE_TMTC_TCP_BRIDGE == 0 */
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(70);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(300);
|
||||
#endif /* OBSW_ADD_TCPIP_BRIDGE == 1 */
|
||||
}
|
||||
|
@ -6,7 +6,8 @@ ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCoo
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS,
|
||||
ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE),
|
||||
acuHkTableDataset(this) {}
|
||||
coreHk(this),
|
||||
auxHk(this) {}
|
||||
|
||||
ACUHandler::~ACUHandler() {}
|
||||
|
||||
@ -15,243 +16,145 @@ ReturnValue_t ACUHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||
return buildCommandFromCommand(*id, NULL, 0);
|
||||
}
|
||||
|
||||
void ACUHandler::fillCommandAndReplyMap() {
|
||||
GomspaceDeviceHandler::fillCommandAndReplyMap();
|
||||
this->insertInCommandMap(PRINT_CHANNEL_STATS);
|
||||
}
|
||||
void ACUHandler::fillCommandAndReplyMap() { GomspaceDeviceHandler::fillCommandAndReplyMap(); }
|
||||
|
||||
void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
parseHkTableReply(packet);
|
||||
handleDeviceTM(&acuHkTableDataset, id, true);
|
||||
|
||||
if (debugMode) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
acuHkTableDataset.read();
|
||||
float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1;
|
||||
float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1;
|
||||
float temperatureC_3 = acuHkTableDataset.temperature3.value * 0.1;
|
||||
sif::info << "ACU: Temperature 1: " << temperatureC_1 << " °C" << std::endl;
|
||||
sif::info << "ACU: Temperature 2: " << temperatureC_2 << " °C" << std::endl;
|
||||
sif::info << "ACU: Temperature 3: " << temperatureC_3 << " °C" << std::endl;
|
||||
sif::info << "ACU: Ground Watchdog Timer Count: " << acuHkTableDataset.wdtCntGnd.value
|
||||
<< std::endl;
|
||||
PoolReadGuard pg0(&auxHk);
|
||||
PoolReadGuard pg1(&coreHk);
|
||||
if (pg0.getReadResult() != RETURN_OK or pg1.getReadResult() != RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
for (size_t idx = 0; idx < 3; idx++) {
|
||||
float tempC = coreHk.temperatures[idx] * 0.1;
|
||||
sif::info << "ACU: Temperature " << idx << ": " << tempC << " °C" << std::endl;
|
||||
}
|
||||
sif::info << "ACU: Ground Watchdog Timer Count: " << auxHk.wdtCntGnd.value << std::endl;
|
||||
sif::info << "ACU: Ground watchdog timer, seconds left before reboot: "
|
||||
<< acuHkTableDataset.wdtGndLeft.value << std::endl;
|
||||
acuHkTableDataset.commit();
|
||||
<< auxHk.wdtGndLeft.value << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) {
|
||||
if (sid == acuHkTableDataset.getSid()) {
|
||||
return &acuHkTableDataset;
|
||||
if (sid == coreHk.getSid()) {
|
||||
return &coreHk;
|
||||
} else if (sid == auxHk.getSid()) {
|
||||
return &auxHk;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ACUHandler::parseHkTableReply(const uint8_t *packet) {
|
||||
ReturnValue_t ACUHandler::parseHkTableReply(const uint8_t *packet) {
|
||||
uint16_t dataOffset = 0;
|
||||
acuHkTableDataset.read();
|
||||
PoolReadGuard pg0(&coreHk);
|
||||
PoolReadGuard pg1(&auxHk);
|
||||
auto res0 = pg0.getReadResult();
|
||||
auto res1 = pg1.getReadResult();
|
||||
if (res0 != RETURN_OK) {
|
||||
return res0;
|
||||
}
|
||||
if (res1 != RETURN_OK) {
|
||||
return res1;
|
||||
}
|
||||
dataOffset += 12;
|
||||
acuHkTableDataset.currentInChannel0 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
coreHk.currentInChannels[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
coreHk.voltageInChannels[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
|
||||
coreHk.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.currentInChannel1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.currentInChannel2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.currentInChannel3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.currentInChannel4 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.currentInChannel5 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
coreHk.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.voltageInChannel0 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.voltageInChannel1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.voltageInChannel2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.voltageInChannel3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.voltageInChannel4 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.voltageInChannel5 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
for (size_t idx = 0; idx < 3; idx++) {
|
||||
coreHk.temperatures[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
|
||||
acuHkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.temperature1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.temperature2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.temperature3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.mpptMode = *(packet + dataOffset);
|
||||
coreHk.mpptMode = packet[dataOffset];
|
||||
dataOffset += 3;
|
||||
|
||||
acuHkTableDataset.vboostInChannel0 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vboostInChannel1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vboostInChannel2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vboostInChannel3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vboostInChannel4 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.vboostInChannel5 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
coreHk.vboostInChannels[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
coreHk.powerInChannels[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
for (size_t idx = 0; idx < 3; idx++) {
|
||||
auxHk.dacEnables[idx] = packet[dataOffset];
|
||||
dataOffset += 3;
|
||||
}
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
auxHk.dacRawChannelVals[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
|
||||
dataOffset += 4;
|
||||
}
|
||||
|
||||
acuHkTableDataset.powerInChannel0 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.powerInChannel1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.powerInChannel2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.powerInChannel3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.powerInChannel4 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.powerInChannel5 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.dac0Enable = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.dac1Enable = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.dac2Enable = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
|
||||
acuHkTableDataset.dacRawChannelVal0 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.dacRawChannelVal1 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.dacRawChannelVal2 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.dacRawChannelVal3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.dacRawChannelVal4 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.dacRawChannelVal5 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.bootCause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
auxHk.bootCause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
dataOffset += 6;
|
||||
acuHkTableDataset.bootcnt = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
coreHk.bootcnt = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
dataOffset += 6;
|
||||
acuHkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
coreHk.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
dataOffset += 6;
|
||||
acuHkTableDataset.resetCause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
auxHk.resetCause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
acuHkTableDataset.mpptTime = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
coreHk.mpptTime = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
/* +12 because here starts the second csp packet */
|
||||
dataOffset += 2 + 12;
|
||||
|
||||
acuHkTableDataset.mpptPeriod = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
coreHk.mpptPeriod = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
|
||||
dataOffset += 4;
|
||||
|
||||
acuHkTableDataset.device0 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device1 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device2 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device3 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device4 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device5 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device6 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device7 = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
for (size_t idx = 0; idx < 8; idx++) {
|
||||
auxHk.deviceTypes[idx] = packet[dataOffset];
|
||||
dataOffset += 3;
|
||||
}
|
||||
for (size_t idx = 0; idx < 8; idx++) {
|
||||
auxHk.devicesStatus[idx] = packet[dataOffset];
|
||||
dataOffset += 3;
|
||||
}
|
||||
|
||||
acuHkTableDataset.device0Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device1Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device2Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device3Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device4Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device5Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device6Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
acuHkTableDataset.device7Status = *(packet + dataOffset);
|
||||
dataOffset += 3;
|
||||
|
||||
acuHkTableDataset.wdtCntGnd = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
auxHk.wdtCntGnd = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
dataOffset += 6;
|
||||
acuHkTableDataset.wdtGndLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
auxHk.wdtGndLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
|
||||
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
|
||||
dataOffset += 6;
|
||||
|
||||
acuHkTableDataset.commit();
|
||||
coreHk.setValidity(true, true);
|
||||
auxHk.setValidity(true, true);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
using namespace P60System;
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL0, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL1, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL2, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL3, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL4, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNEL5, new PoolEntry<int16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL0, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL1, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL2, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL3, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNEL5, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_CURRENT_IN_CHANNELS, new PoolEntry<int16_t>(6));
|
||||
localDataPoolMap.emplace(pool::ACU_VOLTAGE_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_VCC, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBAT, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_2, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_TEMPERATURE_3, new PoolEntry<int16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_TEMPERATURES, new PoolEntry<int16_t>(3));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_MODE, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL0, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL1, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL2, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL3, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_CHANNEL5, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_VBOOST_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_IN_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL0, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL1, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL2, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL3, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_POWER_CHANNEL5, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_EN_0, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_EN_1, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_EN_2, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_0, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_1, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_2, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_3, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_5, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_ENABLES, new PoolEntry<uint8_t>(3));
|
||||
localDataPoolMap.emplace(pool::ACU_DAC_RAW_CHANNELS, new PoolEntry<uint16_t>(6));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_BOOTCNT, new PoolEntry<uint32_t>({0}));
|
||||
@ -260,65 +163,47 @@ ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localData
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_TIME, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_MPPT_PERIOD, new PoolEntry<uint16_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_0, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_1, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_2, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_3, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_4, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_5, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_6, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_7, new PoolEntry<uint8_t>({0}));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICES, new PoolEntry<uint8_t>(8));
|
||||
localDataPoolMap.emplace(pool::ACU_DEVICES_STATUS, new PoolEntry<uint8_t>(8));
|
||||
|
||||
localDataPoolMap.emplace(pool::ACU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
|
||||
localDataPoolMap.emplace(pool::ACU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
|
||||
|
||||
poolManager.subscribeForPeriodicPacket(acuHkTableDataset.getSid(), false, 30.0, false);
|
||||
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true);
|
||||
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ACUHandler::childCommandHook(DeviceCommandId_t cmd, const uint8_t *commandData,
|
||||
size_t commandDataLen) {
|
||||
switch (cmd) {
|
||||
case PRINT_CHANNEL_STATS: {
|
||||
printChannelStats();
|
||||
return RETURN_OK;
|
||||
}
|
||||
default: {
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
void ACUHandler::printChannelStats() {
|
||||
PoolReadGuard pg(&coreHk);
|
||||
sif::info << "ACU Info: Current [mA], Voltage [mV]" << std::endl;
|
||||
for (size_t idx = 0; idx < 6; idx++) {
|
||||
sif::info << std::setw(8) << std::left << "Channel " << idx << std::dec << "| "
|
||||
<< static_cast<unsigned int>(coreHk.currentInChannels[idx]) << std::setw(15)
|
||||
<< std::right << coreHk.voltageInChannels[idx] << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void ACUHandler::printChannelStats() {
|
||||
PoolReadGuard pg(&acuHkTableDataset);
|
||||
sif::info << "ACU Info: Current [mA], Voltage [mV]" << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch0" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel0.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel0.value << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch1" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel1.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel1.value << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch2" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel2.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel2.value << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch3" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel3.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel3.value << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch4" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel4.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel4.value << std::endl;
|
||||
sif::info << std::setw(8) << std::left << "Ch5" << std::dec << "| "
|
||||
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel5.value) << std::setw(15)
|
||||
<< std::right << acuHkTableDataset.voltageInChannel5.value << std::endl;
|
||||
}
|
||||
|
||||
void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; }
|
||||
|
||||
ReturnValue_t ACUHandler::printStatus(DeviceCommandId_t cmd) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
switch (cmd) {
|
||||
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||
PoolReadGuard pg(&coreHk);
|
||||
result = pg.getReadResult();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
break;
|
||||
}
|
||||
printChannelStats();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Reading PDU1 HK table failed!" << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -29,24 +29,22 @@ class ACUHandler : public GomspaceDeviceHandler {
|
||||
*/
|
||||
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
|
||||
|
||||
virtual void fillCommandAndReplyMap() override;
|
||||
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
|
||||
|
||||
virtual ReturnValue_t childCommandHook(DeviceCommandId_t cmd, const uint8_t* commandData,
|
||||
size_t commandDataLen) override;
|
||||
virtual void fillCommandAndReplyMap() override;
|
||||
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
|
||||
private:
|
||||
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
|
||||
|
||||
ACU::HkTableDataset acuHkTableDataset;
|
||||
ACU::CoreHk coreHk;
|
||||
ACU::AuxHk auxHk;
|
||||
bool debugMode = false;
|
||||
|
||||
/**
|
||||
* @brief Function extracts the hk table information from the received csp packet and stores
|
||||
* the values in the acuHkTableDataset.
|
||||
*/
|
||||
void parseHkTableReply(const uint8_t* packet);
|
||||
ReturnValue_t parseHkTableReply(const uint8_t* packet);
|
||||
|
||||
/**
|
||||
* @brief Prints channel statistics (current and voltage) to console
|
||||
|
@ -251,7 +251,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
default: {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
sif::warning << "Reading P60 Dock HK table failed" << std::endl;
|
||||
|
@ -122,7 +122,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
|
@ -76,7 +76,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
|
@ -490,10 +490,9 @@ void PayloadPcduHandler::checkAdcValues() {
|
||||
|
||||
void PayloadPcduHandler::checkJsonFileInit() {
|
||||
if (not jsonFileInitComplete) {
|
||||
sd::SdCard prefSd;
|
||||
sdcMan->getPreferredSdCard(prefSd);
|
||||
if (sdcMan->isSdCardMounted(prefSd)) {
|
||||
params.initialize(sdcMan->getCurrentMountPrefix(prefSd));
|
||||
sd::SdCard activeSd = sdcMan->getActiveSdCard();
|
||||
if (sdcMan->isSdCardMounted(activeSd)) {
|
||||
params.initialize(sdcMan->getCurrentMountPrefix());
|
||||
jsonFileInitComplete = true;
|
||||
}
|
||||
}
|
||||
|
@ -158,18 +158,18 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
int16_t tempRaw = ((packet[offset] & 0x0f) << 8) | packet[offset + 1];
|
||||
dataset.temperatureCelcius = tempRaw * 0.125;
|
||||
offset += 2;
|
||||
dataset.ain0 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
dataset.ain0 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
offset += 2;
|
||||
dataset.ain1 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
dataset.ain1 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
offset += 6;
|
||||
dataset.ain4 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
dataset.ain4 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
offset += 2;
|
||||
dataset.ain5 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
dataset.ain5 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
offset += 2;
|
||||
dataset.ain6 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
dataset.ain6 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
offset += 2;
|
||||
dataset.ain7 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
|
||||
dataset.ain7 = (*(packet + offset) << 8) | *(packet + offset + 1);
|
||||
dataset.setValidity(true, true);
|
||||
if (printPeriodicData) {
|
||||
sif::info << "Radiation sensor temperature: " << dataset.temperatureCelcius << " °C"
|
||||
<< std::dec << std::endl;
|
||||
|
@ -14,7 +14,7 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER;
|
||||
static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO);
|
||||
|
||||
static constexpr DeviceCommandId_t GPS_REPLY = 0;
|
||||
static constexpr DeviceCommandId_t TRIGGER_RESET_PIN = 5;
|
||||
static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5;
|
||||
|
||||
static constexpr uint32_t DATASET_ID = 0;
|
||||
|
||||
|
@ -38,7 +38,8 @@ static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND]
|
||||
static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND]
|
||||
static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND]
|
||||
|
||||
//!< [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console
|
||||
//! [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console
|
||||
//! For the ACU device, only print voltages and currents of the 6 ACU channels
|
||||
static const DeviceCommandId_t PRINT_SWITCH_V_I = 32;
|
||||
static const DeviceCommandId_t PRINT_LATCHUPS = 33;
|
||||
|
||||
@ -55,7 +56,8 @@ enum class SetIds : uint32_t {
|
||||
PDU_2_AUX = 4,
|
||||
P60_CORE = 5,
|
||||
P60_AUX = 6,
|
||||
ACU = 7
|
||||
ACU_CORE = 7,
|
||||
ACU_AUX = 8
|
||||
};
|
||||
|
||||
namespace pool {
|
||||
@ -129,67 +131,24 @@ enum Ids : lp_id_t {
|
||||
PDU_WDT_CSP_LEFT2,
|
||||
|
||||
/** ACU Ids */
|
||||
ACU_CURRENT_IN_CHANNEL0,
|
||||
ACU_CURRENT_IN_CHANNEL1,
|
||||
ACU_CURRENT_IN_CHANNEL2,
|
||||
ACU_CURRENT_IN_CHANNEL3,
|
||||
ACU_CURRENT_IN_CHANNEL4,
|
||||
ACU_CURRENT_IN_CHANNEL5,
|
||||
ACU_VOLTAGE_IN_CHANNEL0,
|
||||
ACU_VOLTAGE_IN_CHANNEL1,
|
||||
ACU_VOLTAGE_IN_CHANNEL2,
|
||||
ACU_VOLTAGE_IN_CHANNEL3,
|
||||
ACU_VOLTAGE_IN_CHANNEL4,
|
||||
ACU_VOLTAGE_IN_CHANNEL5,
|
||||
ACU_CURRENT_IN_CHANNELS,
|
||||
ACU_VOLTAGE_IN_CHANNELS,
|
||||
ACU_VCC,
|
||||
ACU_VBAT,
|
||||
ACU_TEMPERATURE_1,
|
||||
ACU_TEMPERATURE_2,
|
||||
ACU_TEMPERATURE_3,
|
||||
ACU_TEMPERATURES,
|
||||
ACU_MPPT_MODE,
|
||||
ACU_VBOOST_CHANNEL0,
|
||||
ACU_VBOOST_CHANNEL1,
|
||||
ACU_VBOOST_CHANNEL2,
|
||||
ACU_VBOOST_CHANNEL3,
|
||||
ACU_VBOOST_CHANNEL4,
|
||||
ACU_VBOOST_CHANNEL5,
|
||||
ACU_POWER_CHANNEL0,
|
||||
ACU_POWER_CHANNEL1,
|
||||
ACU_POWER_CHANNEL2,
|
||||
ACU_POWER_CHANNEL3,
|
||||
ACU_POWER_CHANNEL4,
|
||||
ACU_POWER_CHANNEL5,
|
||||
ACU_DAC_EN_0,
|
||||
ACU_DAC_EN_1,
|
||||
ACU_DAC_EN_2,
|
||||
ACU_DAC_RAW_0,
|
||||
ACU_DAC_RAW_1,
|
||||
ACU_DAC_RAW_2,
|
||||
ACU_DAC_RAW_3,
|
||||
ACU_DAC_RAW_4,
|
||||
ACU_DAC_RAW_5,
|
||||
ACU_VBOOST_IN_CHANNELS,
|
||||
ACU_POWER_IN_CHANNELS,
|
||||
ACU_DAC_ENABLES,
|
||||
ACU_DAC_RAW_CHANNELS,
|
||||
ACU_BOOTCAUSE,
|
||||
ACU_BOOTCNT,
|
||||
ACU_UPTIME,
|
||||
ACU_RESET_CAUSE,
|
||||
ACU_MPPT_TIME,
|
||||
ACU_MPPT_PERIOD,
|
||||
ACU_DEVICE_0,
|
||||
ACU_DEVICE_1,
|
||||
ACU_DEVICE_2,
|
||||
ACU_DEVICE_3,
|
||||
ACU_DEVICE_4,
|
||||
ACU_DEVICE_5,
|
||||
ACU_DEVICE_6,
|
||||
ACU_DEVICE_7,
|
||||
ACU_DEVICE_0_STATUS,
|
||||
ACU_DEVICE_1_STATUS,
|
||||
ACU_DEVICE_2_STATUS,
|
||||
ACU_DEVICE_3_STATUS,
|
||||
ACU_DEVICE_4_STATUS,
|
||||
ACU_DEVICE_5_STATUS,
|
||||
ACU_DEVICE_6_STATUS,
|
||||
ACU_DEVICE_7_STATUS,
|
||||
ACU_DEVICES,
|
||||
ACU_DEVICES_STATUS,
|
||||
ACU_WDT_CNT_GND,
|
||||
ACU_WDT_GND_LEFT,
|
||||
};
|
||||
@ -592,143 +551,76 @@ static const uint16_t MAX_HKTABLE_ADDRESS = 120;
|
||||
static const uint8_t HK_TABLE_ENTRIES = 64;
|
||||
static const uint16_t HK_TABLE_REPLY_SIZE = 262;
|
||||
|
||||
/**
|
||||
* @brief This class defines a dataset for the hk table of the ACU.
|
||||
*/
|
||||
class HkTableDataset : public StaticLocalDataSet<HK_TABLE_ENTRIES> {
|
||||
class CoreHk : public StaticLocalDataSet<14> {
|
||||
public:
|
||||
HkTableDataset(HasLocalDataPoolIF* owner)
|
||||
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::ACU)) {}
|
||||
CoreHk(HasLocalDataPoolIF* owner)
|
||||
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::ACU_CORE)) {}
|
||||
|
||||
HkTableDataset(object_id_t objectId)
|
||||
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU))) {}
|
||||
|
||||
lp_var_t<int16_t> currentInChannel0 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this);
|
||||
lp_var_t<int16_t> currentInChannel1 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL1, this);
|
||||
lp_var_t<int16_t> currentInChannel2 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL2, this);
|
||||
lp_var_t<int16_t> currentInChannel3 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL3, this);
|
||||
lp_var_t<int16_t> currentInChannel4 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL4, this);
|
||||
lp_var_t<int16_t> currentInChannel5 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL5, this);
|
||||
|
||||
lp_var_t<uint16_t> voltageInChannel0 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL0, this);
|
||||
lp_var_t<uint16_t> voltageInChannel1 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL1, this);
|
||||
lp_var_t<uint16_t> voltageInChannel2 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL2, this);
|
||||
lp_var_t<uint16_t> voltageInChannel3 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL3, this);
|
||||
lp_var_t<uint16_t> voltageInChannel4 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL4, this);
|
||||
lp_var_t<uint16_t> voltageInChannel5 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL5, this);
|
||||
|
||||
lp_var_t<uint16_t> vcc = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VCC, this);
|
||||
lp_var_t<uint16_t> vbat = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBAT, this);
|
||||
|
||||
lp_var_t<int16_t> temperature1 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_1, this);
|
||||
lp_var_t<int16_t> temperature2 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_2, this);
|
||||
lp_var_t<int16_t> temperature3 =
|
||||
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_3, this);
|
||||
CoreHk(object_id_t objectId)
|
||||
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU_CORE))) {}
|
||||
|
||||
lp_var_t<uint8_t> mpptMode =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_MPPT_MODE, this);
|
||||
|
||||
lp_var_t<uint16_t> vboostInChannel0 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL0, this);
|
||||
lp_var_t<uint16_t> vboostInChannel1 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL1, this);
|
||||
lp_var_t<uint16_t> vboostInChannel2 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL2, this);
|
||||
lp_var_t<uint16_t> vboostInChannel3 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL3, this);
|
||||
lp_var_t<uint16_t> vboostInChannel4 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL4, this);
|
||||
lp_var_t<uint16_t> vboostInChannel5 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL5, this);
|
||||
lp_vec_t<int16_t, 6> currentInChannels =
|
||||
lp_vec_t<int16_t, 6>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNELS, this);
|
||||
lp_vec_t<uint16_t, 6> voltageInChannels =
|
||||
lp_vec_t<uint16_t, 6>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNELS, this);
|
||||
|
||||
lp_var_t<uint16_t> powerInChannel0 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL0, this);
|
||||
lp_var_t<uint16_t> powerInChannel1 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL1, this);
|
||||
lp_var_t<uint16_t> powerInChannel2 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL2, this);
|
||||
lp_var_t<uint16_t> powerInChannel3 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL3, this);
|
||||
lp_var_t<uint16_t> powerInChannel4 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL4, this);
|
||||
lp_var_t<uint16_t> powerInChannel5 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL5, this);
|
||||
lp_var_t<uint16_t> vcc = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VCC, this);
|
||||
lp_var_t<uint16_t> vbat = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBAT, this);
|
||||
|
||||
lp_var_t<uint8_t> dac0Enable =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_0, this);
|
||||
lp_var_t<uint8_t> dac1Enable =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_1, this);
|
||||
lp_var_t<uint8_t> dac2Enable =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_2, this);
|
||||
lp_vec_t<uint16_t, 6> vboostInChannels =
|
||||
lp_vec_t<uint16_t, 6>(sid.objectId, P60System::pool::ACU_VBOOST_IN_CHANNELS, this);
|
||||
lp_vec_t<uint16_t, 6> powerInChannels =
|
||||
lp_vec_t<uint16_t, 6>(sid.objectId, P60System::pool::ACU_POWER_IN_CHANNELS, this);
|
||||
|
||||
lp_var_t<uint16_t> dacRawChannelVal0 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_0, this);
|
||||
lp_var_t<uint16_t> dacRawChannelVal1 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_1, this);
|
||||
lp_var_t<uint16_t> dacRawChannelVal2 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_2, this);
|
||||
lp_var_t<uint16_t> dacRawChannelVal3 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_3, this);
|
||||
lp_var_t<uint16_t> dacRawChannelVal4 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_4, this);
|
||||
lp_var_t<uint16_t> dacRawChannelVal5 =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_5, this);
|
||||
lp_vec_t<int16_t, 3> temperatures =
|
||||
lp_vec_t<int16_t, 3>(sid.objectId, P60System::pool::ACU_TEMPERATURES, this);
|
||||
|
||||
lp_var_t<uint32_t> bootCause =
|
||||
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_BOOTCAUSE, this);
|
||||
lp_var_t<uint32_t> bootcnt = lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_BOOTCNT, this);
|
||||
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_UPTIME, this);
|
||||
lp_var_t<uint16_t> resetCause =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_RESET_CAUSE, this);
|
||||
lp_var_t<uint16_t> mpptTime =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_TIME, this);
|
||||
lp_var_t<uint16_t> mpptPeriod =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_PERIOD, this);
|
||||
};
|
||||
/**
|
||||
* @brief This class defines a dataset for the hk table of the ACU.
|
||||
*/
|
||||
class AuxHk : public StaticLocalDataSet<12> {
|
||||
public:
|
||||
AuxHk(HasLocalDataPoolIF* owner)
|
||||
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::ACU_AUX)) {}
|
||||
|
||||
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_0, this);
|
||||
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_1, this);
|
||||
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_2, this);
|
||||
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_3, this);
|
||||
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_4, this);
|
||||
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_5, this);
|
||||
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_6, this);
|
||||
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_7, this);
|
||||
AuxHk(object_id_t objectId)
|
||||
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU_AUX))) {}
|
||||
|
||||
lp_var_t<uint8_t> device0Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_0_STATUS, this);
|
||||
lp_var_t<uint8_t> device1Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_1_STATUS, this);
|
||||
lp_var_t<uint8_t> device2Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_2_STATUS, this);
|
||||
lp_var_t<uint8_t> device3Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_3_STATUS, this);
|
||||
lp_var_t<uint8_t> device4Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_4_STATUS, this);
|
||||
lp_var_t<uint8_t> device5Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_5_STATUS, this);
|
||||
lp_var_t<uint8_t> device6Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_6_STATUS, this);
|
||||
lp_var_t<uint8_t> device7Status =
|
||||
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_7_STATUS, this);
|
||||
lp_vec_t<uint8_t, 3> dacEnables =
|
||||
lp_vec_t<uint8_t, 3>(sid.objectId, P60System::pool::ACU_DAC_ENABLES, this);
|
||||
|
||||
lp_vec_t<uint16_t, 6> dacRawChannelVals =
|
||||
lp_vec_t<uint16_t, 6>(sid.objectId, P60System::pool::ACU_DAC_RAW_CHANNELS, this);
|
||||
|
||||
lp_var_t<uint32_t> bootCause =
|
||||
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_BOOTCAUSE, this);
|
||||
lp_var_t<uint16_t> resetCause =
|
||||
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_RESET_CAUSE, this);
|
||||
|
||||
lp_var_t<uint32_t> wdtCntGnd =
|
||||
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_WDT_CNT_GND, this);
|
||||
lp_var_t<uint32_t> wdtGndLeft =
|
||||
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_WDT_GND_LEFT, this);
|
||||
|
||||
/**
|
||||
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
|
||||
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
|
||||
*/
|
||||
lp_vec_t<uint8_t, 8> deviceTypes =
|
||||
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::ACU_DEVICES, this);
|
||||
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
|
||||
lp_vec_t<uint8_t, 8> devicesStatus =
|
||||
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::ACU_DEVICES_STATUS, this);
|
||||
};
|
||||
} // namespace ACU
|
||||
|
||||
|
@ -8,9 +8,11 @@
|
||||
class SdCardMountedIF {
|
||||
public:
|
||||
virtual ~SdCardMountedIF(){};
|
||||
virtual std::string getCurrentMountPrefix(sd::SdCard prefSdCardPtr = sd::SdCard::NONE) = 0;
|
||||
virtual std::string getCurrentMountPrefix() const = 0;
|
||||
virtual bool isSdCardMounted(sd::SdCard sdCard) = 0;
|
||||
virtual ReturnValue_t getPreferredSdCard(sd::SdCard& sdCard) const = 0;
|
||||
virtual sd::SdCard getPreferredSdCard() const = 0;
|
||||
virtual void setActiveSdCard(sd::SdCard sdCard) = 0;
|
||||
virtual sd::SdCard getActiveSdCard() const = 0;
|
||||
|
||||
private:
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ def prompt_ssh_key_removal():
|
||||
print("Invalid port detected")
|
||||
else:
|
||||
break
|
||||
cmd = f'ssh-keygen -f "${{HOME}}/.ssh/known_hosts" -R "[localhost]:${port}"'
|
||||
cmd = f'ssh-keygen -f "$HOME/.ssh/known_hosts" -R "[localhost]:{port}"'
|
||||
print(f"Removing problematic SSH key with command {cmd}..")
|
||||
os.system(cmd)
|
||||
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 6a209e1a0badc0db91a03e1ef32d43de54d58958
|
||||
Subproject commit 8a008557983d496239a0afe252c8bb38983d2f11
|
Loading…
Reference in New Issue
Block a user