integrated log level, log suscription and debug camera parameter setting in startup routine
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Jakob Meier 2022-02-11 08:24:35 +01:00
parent 1e40013210
commit b1973f77f7
2 changed files with 31 additions and 1 deletions

View File

@ -266,7 +266,7 @@ void StarTrackerHandler::doStartUp() {
return;
case StartupState::BOOT_DELAY:
if (bootCountdown.hasTimedOut()) {
startupState = StartupState::LIMITS;
startupState = StartupState::LOGLEVEL;
}
return;
case StartupState::DONE:
@ -313,6 +313,11 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
bootCountdown.setTimeout(BOOT_TIMEOUT);
startupState = StartupState::BOOT_DELAY;
return buildCommandFromCommand(*id, nullptr, 0);
case StartupState::LOGLEVEL:
startupState = StartupState::WAIT_FOR_EXECUTION;
*id = StarTracker::LOGLEVEL;
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
paramJsonFile.size());
case StartupState::LIMITS:
startupState = StartupState::WAIT_FOR_EXECUTION;
*id = StarTracker::LIMITS;
@ -363,6 +368,16 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
*id = StarTracker::ALGO;
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
paramJsonFile.size());
case StartupState::LOG_SUBSCRIPTION:
startupState = StartupState::WAIT_FOR_EXECUTION;
*id = StarTracker::LOGSUBSCRIPTION;
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
paramJsonFile.size());
case StartupState::DEBUG_CAMERA:
startupState = StartupState::WAIT_FOR_EXECUTION;
*id = StarTracker::DEBUG_CAMERA;
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
paramJsonFile.size());
default:
break;
}
@ -2422,6 +2437,10 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat
void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
switch (*parameterId) {
case (StarTracker::ID::LOG_LEVEL): {
startupState = StartupState::LIMITS;
break;
}
case (StarTracker::ID::LIMITS): {
startupState = StartupState::TRACKING;
break;
@ -2459,6 +2478,14 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
break;
}
case (StarTracker::ID::ALGO): {
startupState = StartupState::LOG_SUBSCRIPTION;
break;
}
case (StarTracker::ID::LOG_SUBSCRIPTION): {
startupState = StartupState::DEBUG_CAMERA;
break;
}
case (StarTracker::ID::DEBUG_CAMERA): {
startupState = StartupState::DONE;
break;
}

View File

@ -296,6 +296,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
CHECK_BOOT_STATE,
BOOT,
BOOT_DELAY,
LOGLEVEL,
LIMITS,
TRACKING,
MOUNTING,
@ -307,6 +308,8 @@ class StarTrackerHandler : public DeviceHandlerBase {
MATCHING,
VALIDATION,
ALGO,
LOG_SUBSCRIPTION,
DEBUG_CAMERA,
WAIT_FOR_EXECUTION,
DONE
};