param update STR
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...

This commit is contained in:
Robin Müller 2023-03-31 18:51:16 +02:00
parent 013692cc41
commit 3f8603967c
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 29 additions and 17 deletions

View File

@ -213,6 +213,8 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
default:
break;
}
// In case the JSON has changed, reinitiate the next parameter set to update.
reinitNextSetParam = true;
return DeviceHandlerBase::executeAction(actionId, commandedBy, data, size);
}
@ -273,6 +275,7 @@ void StarTrackerHandler::doShutDown() {
startupState = StartupState::IDLE;
bootState = FwBootState::NONE;
solutionSet.setReportingEnabled(false);
reinitNextSetParam = false;
setMode(_MODE_POWER_DOWN);
}
@ -313,6 +316,8 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
if (bootCountdown.isBusy()) {
return NOTHING_TO_SEND;
}
// Was already done.
reinitNextSetParam = false;
bootState = FwBootState::REQ_VERSION;
}
switch (bootState) {
@ -461,7 +466,8 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
return returnvalue::OK;
}
case (startracker::SUBSCRIPTION): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.subscription,
reinitNextSetParam);
return returnvalue::OK;
}
case (startracker::REQ_SOLUTION): {
@ -477,55 +483,55 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
return returnvalue::OK;
}
case (startracker::LIMITS): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.limits, reinitNextSetParam);
return result;
}
case (startracker::MOUNTING): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.mounting, reinitNextSetParam);
return result;
}
case (startracker::IMAGE_PROCESSOR): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.imageProcessor, reinitNextSetParam);
return result;
}
case (startracker::CAMERA): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.camera, reinitNextSetParam);
return result;
}
case (startracker::CENTROIDING): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.centroiding, reinitNextSetParam);
return result;
}
case (startracker::LISA): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.lisa, reinitNextSetParam);
return result;
}
case (startracker::MATCHING): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.matching, reinitNextSetParam);
return result;
}
case (startracker::VALIDATION): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.validation, reinitNextSetParam);
return result;
}
case (startracker::ALGO): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.algo, reinitNextSetParam);
return result;
}
case (startracker::TRACKING): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.tracking, reinitNextSetParam);
return result;
}
case (startracker::LOGLEVEL): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logLevel, reinitNextSetParam);
return result;
}
case (startracker::LOGSUBSCRIPTION): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.logSubscription, reinitNextSetParam);
return result;
}
case (startracker::DEBUG_CAMERA): {
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera);
result = prepareParamCommand(commandData, commandDataLen, jcfgs.debugCamera, reinitNextSetParam);
return result;
}
case (startracker::CHECKSUM): {
@ -1690,12 +1696,16 @@ void StarTrackerHandler::prepareHistogramRequest() {
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
size_t commandDataLen,
ArcsecJsonParamBase& paramSet) {
ArcsecJsonParamBase& paramSet,
bool reinitSet) {
// Stopwatch watch;
ReturnValue_t result = returnvalue::OK;
if (commandDataLen > MAX_PATH_SIZE) {
return FILE_PATH_TOO_LONG;
}
if(reinitSet) {
result = paramSet.init(paramJsonFile);
}
result = paramSet.create(commandBuffer);
if (result != returnvalue::OK) {

View File

@ -287,6 +287,8 @@ class StarTrackerHandler : public DeviceHandlerBase {
InternalState internalState = InternalState::IDLE;
bool reinitNextSetParam = false;
bool strHelperHandlingSpecialRequest = false;
const power::Switch_t powerSwitch = power::NO_SWITCH;
@ -409,7 +411,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
* @return returnvalue::OK if successful, otherwise error return Value
*/
ReturnValue_t prepareParamCommand(const uint8_t* commandData, size_t commandDataLen,
ArcsecJsonParamBase& paramSet);
ArcsecJsonParamBase& paramSet, bool reinitSet);
/**
* @brief The following function will fill the command buffer with the command to request

2
tmtc

@ -1 +1 @@
Subproject commit aab50dce5ace6878432377fff5e6b2cd1c485213
Subproject commit 5b613f98eea415242c152ed3498ed3c0434f139f