passivate normal mode for special requests
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2023-03-21 18:05:29 +01:00
parent bb0c4ac03e
commit b9cf144c1f
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 12 additions and 9 deletions

View File

@ -49,7 +49,7 @@ uint8_t ArcsecDatalinkLayer::getReplyFrameType() { return decodedFrame[0]; }
const uint8_t* ArcsecDatalinkLayer::getReply() { return &decodedFrame[1]; } const uint8_t* ArcsecDatalinkLayer::getReply() { return &decodedFrame[1]; }
void ArcsecDatalinkLayer::encodeFrame(const uint8_t* data, uint32_t length) { void ArcsecDatalinkLayer::encodeFrame(const uinah uint32_t length) {
arc_transport_encode_body(data, length, encBuffer, &encFrameSize); arc_transport_encode_body(data, length, encBuffer, &encFrameSize);
} }

View File

@ -129,7 +129,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
break; break;
} }
if (strHelperExecuting == true) { if (strHelperHandlingSpecialRequest == true) {
return STR_HELPER_EXECUTING; return STR_HELPER_EXECUTING;
} }
@ -157,7 +157,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
strHelperExecuting = true; strHelperHandlingSpecialRequest = true;
return EXECUTION_FINISHED; return EXECUTION_FINISHED;
} }
case (startracker::DOWNLOAD_IMAGE): { case (startracker::DOWNLOAD_IMAGE): {
@ -173,7 +173,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
strHelperExecuting = true; strHelperHandlingSpecialRequest = true;
return EXECUTION_FINISHED; return EXECUTION_FINISHED;
} }
case (startracker::FLASH_READ): { case (startracker::FLASH_READ): {
@ -185,7 +185,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
strHelperExecuting = true; strHelperHandlingSpecialRequest = true;
return EXECUTION_FINISHED; return EXECUTION_FINISHED;
} }
case (startracker::CHANGE_IMAGE_DOWNLOAD_FILE): { case (startracker::CHANGE_IMAGE_DOWNLOAD_FILE): {
@ -215,7 +215,7 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
strHelperExecuting = true; strHelperHandlingSpecialRequest = true;
return EXECUTION_FINISHED; return EXECUTION_FINISHED;
} }
default: default:
@ -283,6 +283,9 @@ void StarTrackerHandler::doShutDown() {
} }
ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) { ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
if (strHelperHandlingSpecialRequest) {
return NOTHING_TO_SEND;
}
switch (normalState) { switch (normalState) {
case NormalState::TEMPERATURE_REQUEST: case NormalState::TEMPERATURE_REQUEST:
*id = startracker::REQ_TEMPERATURE; *id = startracker::REQ_TEMPERATURE;
@ -1296,7 +1299,7 @@ size_t StarTrackerHandler::getNextReplyLength(DeviceCommandId_t commandId) {
ReturnValue_t StarTrackerHandler::doSendReadHook() { ReturnValue_t StarTrackerHandler::doSendReadHook() {
// Prevent DHB from polling UART during commands executed by the image loader task // Prevent DHB from polling UART during commands executed by the image loader task
if (strHelperExecuting) { if (strHelperHandlingSpecialRequest) {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
return returnvalue::OK; return returnvalue::OK;
@ -1538,7 +1541,7 @@ void StarTrackerHandler::handleEvent(EventMessage* eventMessage) {
case objects::STR_HELPER: { case objects::STR_HELPER: {
// All events from image loader signal either that the operation was successful or that it // All events from image loader signal either that the operation was successful or that it
// failed // failed
strHelperExecuting = false; strHelperHandlingSpecialRequest = false;
break; break;
} }
default: default:

View File

@ -291,7 +291,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
InternalState internalState = InternalState::IDLE; InternalState internalState = InternalState::IDLE;
bool strHelperExecuting = false; bool strHelperHandlingSpecialRequest = false;
const power::Switch_t powerSwitch = power::NO_SWITCH; const power::Switch_t powerSwitch = power::NO_SWITCH;