Files
MuditaOS/module-sys/tests/Test1/CommandsService.hpp
Radoslaw Wicik a8573a404c Apply new style
2020-03-17 10:03:16 +01:00

59 lines
1.2 KiB
C++

//
// Created by mati on 26.04.19.
//
#ifndef ACTORS_INITSERVICE_HPP
#define ACTORS_INITSERVICE_HPP
#include "../catch.hpp"
#include "Service/Service.hpp"
#include "SystemManager/SystemManager.hpp"
#include "Service/Message.hpp"
enum class CommandsServiceMsgRequestType
{
SpawnServices,
DestroyServices
};
class CommandsServiceMsgRequest : public sys::DataMessage
{
public:
CommandsServiceMsgRequest() : DataMessage(sys::BusChannels::CommandsServiceRequests)
{}
CommandsServiceMsgRequestType type;
};
class CommandsService : public sys::Service
{
public:
CommandsService(const std::string &name);
~CommandsService()
{}
// Invoked when service received data message
sys::Message_t DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
// Invoked during initialization
sys::ReturnCodes InitHandler() override;
void TickHandler(uint32_t id) override;
sys::ReturnCodes DeinitHandler() override
{
return sys::ReturnCodes::Success;
}
sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override final
{
return sys::ReturnCodes::Success;
}
private:
uint32_t oneShotTimer = 0;
};
#endif // ACTORS_INITSERVICE_HPP