RW Refactoring #381

Merged
meggert merged 20 commits from rw_refactoring into develop 2023-02-17 10:35:31 +01:00
Showing only changes of commit 29e031f0df - Show all commits

View File

@ -43,7 +43,8 @@ void RwHandler::doShutDown() {
}
internalState = InternalState::DEFAULT;
updatePeriodicReply(false, rws::REPLY_ID);
setMode(_MODE_POWER_DOWN);
// The power switch is handled by the assembly, so we can go off here directly.
setMode(MODE_OFF);
}
ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
@ -148,7 +149,7 @@ void RwHandler::fillCommandAndReplyMap() {
ReturnValue_t RwHandler::scanForReply(const uint8_t* start, size_t remainingSize,
DeviceCommandId_t* foundId, size_t* foundLen) {
if (getMode() == _MODE_WAIT_OFF) {
if (getMode() == _MODE_WAIT_OFF or getMode() == _MODE_WAIT_ON) {
return IGNORE_FULL_PACKET;
}
if (remainingSize > 0) {