1
0
forked from fsfw/fsfw

form improvements DHB

This commit is contained in:
2020-10-12 18:18:41 +02:00
parent 335e146735
commit 140aa3ab42
19 changed files with 403 additions and 303 deletions

View File

@ -1,12 +1,19 @@
#ifndef DEVICEHANDLERIF_H_
#define DEVICEHANDLERIF_H_
#ifndef FSFW_DEVICEHANDLERS_DEVICEHANDLERIF_H_
#define FSFW_DEVICEHANDLERS_DEVICEHANDLERIF_H_
#include "DeviceHandlerMessage.h"
#include "../action/HasActionsIF.h"
#include "DeviceHandlerMessage.h"
#include "../events/Event.h"
#include "../modes/HasModesIF.h"
#include "../ipc/MessageQueueSenderIF.h"
/**
* This is used to uniquely identify commands that are sent to a device
* The values are defined in the device-specific implementations
*/
using DeviceCommandId_t = uint32_t;
/**
* @brief This is the Interface used to communicate with a device handler.
* @details Includes all expected return values, events and modes.
@ -15,6 +22,7 @@
class DeviceHandlerIF {
public:
static const uint8_t TRANSITION_MODE_CHILD_ACTION_MASK = 0x20;
static const uint8_t TRANSITION_MODE_BASE_ACTION_MASK = 0x10;
@ -47,6 +55,8 @@ public:
//! This is a transitional state which can not be commanded.
//! The device handler performs all actions and commands to get the device
//! shut down. When the device is off, the mode changes to @c MODE_OFF.
//! It is possible to set the mode to _MODE_SHUT_DOWN to use the to off
//! transition if available.
static const Mode_t _MODE_SHUT_DOWN = TRANSITION_MODE_CHILD_ACTION_MASK | 6;
//! It is possible to set the mode to _MODE_TO_ON to use the to on
//! transition if available.
@ -96,7 +106,7 @@ public:
static const uint8_t INTERFACE_ID = CLASS_ID::DEVICE_HANDLER_IF;
// Standard codes used when building commands.
static const ReturnValue_t NO_COMMAND_DATA = MAKE_RETURN_CODE(0xA0); //!< If the command size is 0. Checked in DHB
static const ReturnValue_t NO_COMMAND_DATA = MAKE_RETURN_CODE(0xA0); //!< If no command data was given when expected.
static const ReturnValue_t COMMAND_NOT_SUPPORTED = MAKE_RETURN_CODE(0xA1); //!< Command ID not in commandMap. Checked in DHB
static const ReturnValue_t COMMAND_ALREADY_SENT = MAKE_RETURN_CODE(0xA2); //!< Command was already executed. Checked in DHB
static const ReturnValue_t COMMAND_WAS_NOT_SENT = MAKE_RETURN_CODE(0xA3);
@ -150,4 +160,4 @@ public:
};
#endif /* DEVICEHANDLERIF_H_ */
#endif /* FSFW_DEVICEHANDLERS_DEVICEHANDLERIF_H_ */