Relax SUS FDIR #677

Merged
muellerr merged 17 commits from relax-sus-fdir into main 2023-09-12 10:16:07 +02:00
Showing only changes of commit 5a1b2470f0 - Show all commits

View File

@ -86,7 +86,9 @@ ReturnValue_t SusHandler::scanForReply(const uint8_t *start, size_t len, DeviceC
}
ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
const auto *reply = reinterpret_cast<const acs::SusReply *>(packet);
if (reply->dataWasSet) {
if (!reply->dataWasSet) {
return returnvalue::OK;
}
if (internalState == InternalState::STARTUP) {
commandExecuted = true;
}
@ -106,7 +108,8 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8
dataset.setValidity(false, true);
dataset.tempC = thermal::INVALID_TEMPERATURE;
std::memset(dataset.channels.value, 0, sizeof(dataset.channels.value));
} else {
return returnvalue::OK;
}
if (invalidMsgCounter > 0) {
triggerEvent(TEMPERATURE_ALL_ONES_RECOVERY, invalidMsgCounter);
Review

maybe decrement here instead of resetting the counter?

maybe decrement here instead of resetting the counter?
Review

Then I'd change the event handling, not sure what would be best here.. Otherwise it could be a lot of events.

Then I'd change the event handling, not sure what would be best here.. Otherwise it could be a lot of events.
Review

not sure either. your call

not sure either. your call
invalidMsgCounter = 0;
@ -114,8 +117,6 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8
dataset.setValidity(true, true);
dataset.tempC = max1227::getTemperature(reply->tempRaw);
std::memcpy(dataset.channels.value, reply->channelsRaw, sizeof(reply->channelsRaw));
}
}
return returnvalue::OK;
}