added get reset and clear reset command to rw handler

This commit is contained in:
2021-06-28 08:57:37 +02:00
parent 3193d007c7
commit ad43ebd587
3 changed files with 137 additions and 16 deletions

View File

@ -84,6 +84,7 @@ private:
RwDefinitions::TemperatureSet temperatureSet;
RwDefinitions::StatusSet statusSet;
RwDefinitions::LastResetSatus lastResetStatusSet;
uint8_t commandBuffer[RwDefinitions::MAX_CMD_SIZE];
@ -95,8 +96,28 @@ private:
CommunicationStep communicationStep = CommunicationStep::READ_TEMPERATURE;
enum class StartupStep {
GET_RESET_STATUS,
CLEAR_RESET_STATUS,
INIT_RW
};
StartupStep startupStep = StartupStep::GET_RESET_STATUS;
size_t sizeOfReply = 0;
bool startupPerformed = false;
/**
* @brief This function prepares the command to request the last reset status
*/
void prepareGetLastResetStatusCommand();
/**
* @brief Fills the command buffer with the command to clear the reset status.
*/
void prepareClearResetStatusCommand();
/**
* @brief This function prepares the send buffer with the data to request the status of
* the reaction wheel.
@ -110,6 +131,13 @@ private:
*/
ReturnValue_t checkSpeedAndRampTime(const uint8_t * commandData, size_t commandDataLen);
/**
* @brief This function fills the commandBuffer with the data to request initialize the
* reaction wheel controller. This command must be sent as soon as the state of a
* reaction wheel is equal to 1 which indicates an error.
*/
void prepareInitRwCommand();
/**
* @brief This function prepares the set speed command from the commandData received with
* an action message.
@ -122,11 +150,12 @@ private:
void prepareGetTemperatureCmd();
/**
* @brief This function fills the commandBuffer with the data to request initialize the
* reaction wheel controller. This command must be sent as soon as the state of a
* reaction wheel is equal to 1 which indicates an error.
* @brief This function writes the last reset status retrieved with the get last reset status
* command into the reset status dataset.
*
* @param packet Pointer to the buffer holding the reply data.
*/
void prepareInitRwCommand();
void handleResetStatusReply(const uint8_t* packet);
/**
* @brief This function handles the reply of the get temperature command.