55 lines
1.9 KiB
C
55 lines
1.9 KiB
C
|
#include "fsfw/devicehandlers/FreshDeviceHandlerBase.h"
|
||
|
#include "fsfw/objectmanager/SystemObjectIF.h"
|
||
|
#include "fsfw_hal/linux/gpio/Gpio.h"
|
||
|
#include "linux/payload/MpsocCommunication.h"
|
||
|
#include "linux/payload/PlocMpsocSpecialComHelper.h"
|
||
|
|
||
|
class FreshMpsocHandler : public FreshDeviceHandlerBase {
|
||
|
public:
|
||
|
FreshMpsocHandler(DhbConfig cfg, MpsocCommunication& comInterface,
|
||
|
PlocMpsocSpecialComHelper* plocMPSoCHelper, Gpio uartIsolatorSwitch,
|
||
|
object_id_t supervisorHandler);
|
||
|
|
||
|
/**
|
||
|
* Periodic helper executed function, implemented by child class.
|
||
|
*/
|
||
|
void performDeviceOperation(uint8_t opCode) override;
|
||
|
|
||
|
/**
|
||
|
* Implemented by child class. Handle all command messages which are
|
||
|
* not health, mode, action or housekeeping messages.
|
||
|
* @param message
|
||
|
* @return
|
||
|
*/
|
||
|
ReturnValue_t handleCommandMessage(CommandMessage* message) override;
|
||
|
|
||
|
ReturnValue_t initialize() override;
|
||
|
|
||
|
private:
|
||
|
// HK manager abstract functions.
|
||
|
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||
|
LocalDataPoolManager& poolManager) override;
|
||
|
|
||
|
// Mode abstract functions
|
||
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||
|
uint32_t* msToReachTheMode) override;
|
||
|
// Action override. Forward to user.
|
||
|
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||
|
const uint8_t* data, size_t size) override;
|
||
|
|
||
|
/**
|
||
|
* @overload
|
||
|
* @param submode
|
||
|
*/
|
||
|
void startTransition(Mode_t newMode, Submode_t submode) override;
|
||
|
|
||
|
ReturnValue_t performDeviceOperationPreQueueHandling(uint8_t opCode) override;
|
||
|
void handleTransitionToOn();
|
||
|
void handleTransitionToOff();
|
||
|
|
||
|
bool transitionActive = false;
|
||
|
MpsocCommunication comInterface;
|
||
|
MessageQueueIF* eventQueue = nullptr;
|
||
|
};
|