From b0a2b5886fe8e91af2d12c62387e1322c4b83adf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 14 Apr 2023 18:45:58 +0200 Subject: [PATCH] hotfix ACS/SUS --- CHANGELOG.md | 3 +++ linux/acs/AcsBoardPolling.cpp | 12 ++++++++---- linux/acs/SusPolling.cpp | 4 +++- tmtc | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b2a491..2c7d6ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ will consitute of a breaking change warranting a new major release: - Bugfix for STR where an invalid reply was received for special requests like firmware updates. - Bugfix for shell command executors in command controller which lead to a crash. +- Fixed regression where the reply result for ACS board and SUS board devices was set to FAILED + even when going to OFF mode. In that case, it has to be set to OK so the device handler can + complete the OFF transition. ## Changed diff --git a/linux/acs/AcsBoardPolling.cpp b/linux/acs/AcsBoardPolling.cpp index bc3dff74..e525bf53 100644 --- a/linux/acs/AcsBoardPolling.cpp +++ b/linux/acs/AcsBoardPolling.cpp @@ -122,13 +122,14 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send } else { sif::warning << "AcsBoardPolling: Unknown ADIS type" << std::endl; } + adis.replyResult = returnvalue::FAILED; adis.performStartup = true; } else if (req->mode == acs::SimpleSensorMode::OFF) { adis.performStartup = false; adis.ownReply.cfgWasSet = false; adis.ownReply.dataWasSet = false; + adis.replyResult = returnvalue::OK; } - adis.replyResult = returnvalue::FAILED; adis.mode = req->mode; } return returnvalue::OK; @@ -144,10 +145,11 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send if (req->mode == acs::SimpleSensorMode::NORMAL) { std::memcpy(gyro.sensorCfg, req->ctrlRegs, 5); gyro.performStartup = true; + gyro.replyResult = returnvalue::FAILED; } else { gyro.ownReply.cfgWasSet = false; + gyro.replyResult = returnvalue::OK; } - gyro.replyResult = returnvalue::FAILED; gyro.mode = req->mode; } return returnvalue::OK; @@ -162,11 +164,12 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send if (req->mode != mgm.mode) { if (req->mode == acs::SimpleSensorMode::NORMAL) { mgm.performStartup = true; + mgm.replyResult = returnvalue::FAILED; } else { mgm.ownReply.dataWasSet = false; + mgm.replyResult = returnvalue::OK; mgm.ownReply.temperatureWasSet = false; } - mgm.replyResult = returnvalue::FAILED; mgm.mode = req->mode; } return returnvalue::OK; @@ -181,10 +184,11 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send if (req->mode != mgm.mode) { if (req->mode == acs::SimpleSensorMode::NORMAL) { mgm.performStartup = true; + mgm.replyResult = returnvalue::FAILED; } else { mgm.ownReply.dataWasRead = false; + mgm.replyResult = returnvalue::OK; } - mgm.replyResult = returnvalue::FAILED; mgm.mode = req->mode; } return returnvalue::OK; diff --git a/linux/acs/SusPolling.cpp b/linux/acs/SusPolling.cpp index 1da5ef5e..2ef02f43 100644 --- a/linux/acs/SusPolling.cpp +++ b/linux/acs/SusPolling.cpp @@ -69,11 +69,13 @@ ReturnValue_t SusPolling::sendMessage(CookieIF* cookie, const uint8_t* sendData, if (susDevs[susIdx].mode != susReq->mode) { if (susReq->mode == acs::SimpleSensorMode::NORMAL) { susDevs[susIdx].performStartup = true; + susDevs[susIdx].replyResult = returnvalue::FAILED; } else { susDevs[susIdx].ownReply.cfgWasSet = false; susDevs[susIdx].ownReply.dataWasSet = false; + // We are off now, but DHB wants a proper reply. + susDevs[susIdx].replyResult = returnvalue::OK; } - susDevs[susIdx].replyResult = returnvalue::FAILED; susDevs[susIdx].mode = susReq->mode; } if (state == InternalState::IDLE) { diff --git a/tmtc b/tmtc index f8da9cff..f5734260 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit f8da9cff7c5d6d6bdd483f90ccefb67b2d1e11a4 +Subproject commit f57342602da3232c0bfecaecb0c10be6d692b384