STR time #611

Merged
muellerr merged 25 commits from str_set_time into main 2023-07-14 12:43:21 +02:00
Showing only changes of commit 3aad452357 - Show all commits

View File

@ -331,7 +331,7 @@ ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t
*id = startracker::REQ_VERSION; *id = startracker::REQ_VERSION;
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
} }
case(FwBootState::SET_TIME): { case (FwBootState::SET_TIME): {
bootState = FwBootState::WAIT_FOR_EXECUTION; bootState = FwBootState::WAIT_FOR_EXECUTION;
*id = startracker::SET_TIME; *id = startracker::SET_TIME;
return buildCommandFromCommand(*id, nullptr, 0); return buildCommandFromCommand(*id, nullptr, 0);
@ -446,7 +446,7 @@ ReturnValue_t StarTrackerHandler::buildCommandFromCommand(DeviceCommandId_t devi
preparePingRequest(); preparePingRequest();
return returnvalue::OK; return returnvalue::OK;
} }
case(startracker::SET_TIME): { case (startracker::SET_TIME): {
SetTimeActionRequest setTimeRequest; SetTimeActionRequest setTimeRequest;
time_t epoch; time_t epoch;
timeval tv; timeval tv;
@ -1366,7 +1366,7 @@ ReturnValue_t StarTrackerHandler::scanForActionReply(uint8_t replyId, DeviceComm
*foundId = startracker::UPLOAD_IMAGE; *foundId = startracker::UPLOAD_IMAGE;
break; break;
} }
case(ARC_ACTION_REQ_SETTIME_ID): { case (ARC_ACTION_REQ_SETTIME_ID): {
*foundId = startracker::SET_TIME; *foundId = startracker::SET_TIME;
break; break;
} }
@ -1982,7 +1982,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() {
startupState = StartupState::BOOT_BOOTLOADER; startupState = StartupState::BOOT_BOOTLOADER;
} }
if (bootState == FwBootState::VERIFY_BOOT) { if (bootState == FwBootState::VERIFY_BOOT) {
bootState = FwBootState::LOGLEVEL; bootState = FwBootState::SET_TIME;
} else if (internalState == InternalState::BOOTLOADER_CHECK) { } else if (internalState == InternalState::BOOTLOADER_CHECK) {
triggerEvent(BOOTING_BOOTLOADER_FAILED_EVENT); triggerEvent(BOOTING_BOOTLOADER_FAILED_EVENT);
internalState = InternalState::FAILED_BOOTLOADER_BOOT; internalState = InternalState::FAILED_BOOTLOADER_BOOT;
@ -2060,9 +2060,9 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(const uint8_t* rawFrame,
} }
void StarTrackerHandler::handleStartup(uint8_t tmType, uint8_t parameterId) { void StarTrackerHandler::handleStartup(uint8_t tmType, uint8_t parameterId) {
switch(tmType) { switch (tmType) {
case(TMTC_ACTIONREPLY): { case (TMTC_ACTIONREPLY): {
case(ARC_ACTION_REQ_SETTIME_ID): { case (ARC_ACTION_REQ_SETTIME_ID): {
bootState = FwBootState::LOGLEVEL; bootState = FwBootState::LOGLEVEL;
return; return;
} }