countdown based timeout

This commit is contained in:
Jakob Meier
2022-04-27 16:08:17 +02:00
parent 42194abb4a
commit 8610e48b19
8 changed files with 48 additions and 12 deletions

View File

@ -8,6 +8,7 @@
#include "fsfw_hal/linux/gpio/Gpio.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw_hal/linux/uart/UartComIF.h"
#include "fsfw/timemanager/Countdown.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
#include "linux/devices/devicedefinitions/SupvReturnValuesIF.h"
#include "PlocSupvHelper.h"
@ -78,6 +79,10 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF;
static const uint8_t EXE_STATUS_OFFSET = 10;
static const uint8_t SIZE_NULL_TERMINATOR = 1;
// 5 s
static const uint32_t EXECUTION_DEFAULT_TIMEOUT = 5000;
// 30 s
static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 30000;
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
@ -128,6 +133,13 @@ class PlocSupervisorHandler : public DeviceHandlerBase {
// Supervisor helper class currently executing a command
bool plocSupvHelperExecuting = false;
Countdown executionTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false);
/**
* @brief Adjusts the timeout of the execution report dependent on command
*/
void setExecutionTimeout(DeviceCommandId_t command);
/**
* @brief Handles event messages received from the supervisor helper
*/