From 516ef34b21a0f563418729c23b64f421ecd3467e Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Mon, 28 Jun 2021 09:31:10 +0200 Subject: [PATCH] added periodically polling of reset status in rw handler --- mission/devices/RwHandler.cpp | 6 +++++- mission/devices/RwHandler.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mission/devices/RwHandler.cpp b/mission/devices/RwHandler.cpp index 83a136b8..7d84bfcf 100644 --- a/mission/devices/RwHandler.cpp +++ b/mission/devices/RwHandler.cpp @@ -42,13 +42,17 @@ void RwHandler::doShutDown() { ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t * id) { switch (communicationStep) { + case CommunicationStep::GET_RESET_STATUS: + *id = RwDefinitions::GET_LAST_RESET_STATUS; + communicationStep = CommunicationStep::READ_TEMPERATURE; + break; case CommunicationStep::READ_TEMPERATURE: *id = RwDefinitions::GET_TEMPERATURE; communicationStep = CommunicationStep::GET_RW_SATUS; break; case CommunicationStep::GET_RW_SATUS: *id = RwDefinitions::GET_RW_STATUS; - communicationStep = CommunicationStep::READ_TEMPERATURE; + communicationStep = CommunicationStep::GET_RESET_STATUS; break; default: sif::debug << "RwHandler::buildNormalDeviceCommand: Invalid communication step" diff --git a/mission/devices/RwHandler.h b/mission/devices/RwHandler.h index 29a2ae52..9521034c 100644 --- a/mission/devices/RwHandler.h +++ b/mission/devices/RwHandler.h @@ -90,6 +90,7 @@ private: uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE]; enum class CommunicationStep { + GET_RESET_STATUS, READ_TEMPERATURE, GET_RW_SATUS };