mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-25 14:29:22 -05:00
59 lines
1.2 KiB
C++
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
|