16 #ifndef HF_CORE_EVENT_SCHEDULING_H 17 #define HF_CORE_EVENT_SCHEDULING_H 83 Interval(uint32_t _start, uint32_t _end, uint32_t _repeat):
119 return (
start <= _time && _time <=
end);
123 static constexpr uint16_t
min_size =
sizeof(uint32_t)
235 uint8_t status,
Interval &time, uint8_t pid);
237 #ifdef HF_CORE_EVENT_SCHEDULING_UPDATE_EVENT_STATUS_CMD 247 uint8_t
id,
bool enabled)
249 Scheduling::IClient::update_event_status(addr, ITF,
id, enabled);
253 #ifdef HF_CORE_EVENT_SCHEDULING_GET_EVENT_ENTRY_CMD 262 Scheduling::IClient::get_event_entry(addr, ITF,
id);
277 #ifdef HF_CORE_EVENT_SCHEDULING_DELETE_ALL_EVENTS_CMD 285 Scheduling::IClient::delete_all_events(addr, ITF);
289 using IClientBase::send;
326 uint8_t number_of_entries()
const;
401 void periodic(uint32_t time);
443 using IServerBase::notify;
461 template<
typename _Entries>
466 "_Entries must be of type HF::Core::Scheduling::IEntries<Interval>");
488 return const_cast<_Entries &
>(_entries);
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Core::Scheduling::Eve...
Scheduling Service : Parent.
UID
Interfaces Unique Identifiers (UID).
This represent the special unit with ID/UID = 0.
uint16_t size() const
Number bytes needed to serialize the message.
Return all mandatory attributes for the interface.
Scheduling Service : Client side implementation.
This file contains the forward declarations of the core services and interfaces implementing classes...
Helper class template for parent class implementation of the interfaces.
Server< Entries< Interval > > DefaultServer
Event Scheduling Service : Server side with default persistence implementation.
virtual void define_event(const Protocol::Address &addr, uint8_t id, uint8_t status, Interval &time, uint8_t pid)
Send a HAN-FUN message containing a Scheduling::DEFINE_EVENT_CMD, to the given network address...
Event Scheduling Service : Client side implementation.
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
This file contains the definitions for the HAN-FUN protocol messages.
virtual void delete_event(const Protocol::Address &addr, uint8_t id)
Send a HAN-FUN message containing a Scheduling::DELETE_CMD, to the given network address.
Helper class to handle the Maximum Number Of Entries attribute for the scheduling services...
Base class for scheduling services entries.
virtual void activate_scheduler(const Protocol::Address &addr, bool enabled)
Send a HAN-FUN message containing a Scheduling::ACTIVATE_SCHEDULER_CMD, to the given network address...
Interval(uint32_t _start, uint32_t _end, uint32_t _repeat)
Constructor.
This file contains the common definitions for the scheduling services.
Scheduling Service : Server side implementation.
IServer(Unit0 &unit)
Constructor.
Message payload for a Scheduling::GET_ENTRY_CMD request.
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
Server(Unit0 &unit)
Constructor.
uint32_t start
Start Date.
Scheduling::GetEntryResponse< Interval > GetEntryResponse
Specific part for the Event Scheduler of the HF::Scheduling::GetEntryResponse.
uint16_t uid() const
This method returns the interface UID.
Event Scheduler specific part for the HF::Scheduling::Entry.
HF::Interface const * owner() const
Helper class to handle the Status attribute for the scheduling services.
Scheduling - Persistent Storage API.
This class represents a byte array.
Helper class to handle the Status attribute for the Event Scheduling service.
uint32_t repeat
Repeat interval (in seconds).
virtual Common::Result update_event_status(const Protocol::Packet &packet, const UpdateStatus &msg)
Callback that is called when a Scheduling::UPDATE_STATUS_CMD, is received.
Common::Pointer< Entry > entry(const uint8_t id) const
Get the Event Scheduling entry given by id.
bool active(uint32_t _time) const
Check if entry is active.
Scheduling Service : Client side implementation.
Event Scheduling interface UID.
Helper class to handle the Maximum Number Of Entries attribute for the Event Scheduling service...
void activate_scheduler(const Protocol::Address &addr, const Interface::UID itf_uid, bool enabled=true)
Send a HAN-FUN message containing a Scheduling::ACTIVATE_SCHEDULER_CMD, to the given network address...
virtual IEntries< Interval > & entries() const =0
Get a reference to the current object implementing the persistence API, for the device information...
Helper class to handle the Number Of Entries attribute for the scheduling services.
Interface/Service Attribute API.
Scheduling Service : Server side implementation.
Simple raw pointer wrapper.
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
Message payload for a Scheduling::UPDATE_STATUS_CMD request.
virtual Common::Result get_event_entry(const Protocol::Packet &packet, const GetEntry &msg)
Callback that is called when a Scheduling::GET_ENTRY_CMD, is received.
uint8_t next_id() const
Return next available id for event.
virtual Common::Result delete_event(const Protocol::Packet &packet, const DeleteEvent &msg)
Callback that is called when a Scheduling::DELETE_CMD, is received.
virtual Common::Result delete_all_events(const Protocol::Packet &packet)
Callback that is called when a Scheduling::DELETE_ALL_CMD, is received.
Common interface for all Interfaces.
virtual ~IClient()
Destructor.
virtual Common::Result define_event(const Protocol::Packet &packet, Scheduling::Entry< Interval > &msg)
Callback that is called when a Scheduling::DEFINE_EVENT_CMD, is received.
Event Scheduling Service : Server side implementation.
HF::Attributes::UIDS attributes(uint8_t pack_id=HF::Attributes::Pack::MANDATORY) const
Return a vector containing the attribute UIDs, for the given pack ID.
void delete_event(const Protocol::Address &addr, const Interface::UID itf_uid, uint8_t id)
Send a HAN-FUN message containing a Scheduling::DELETE_CMD, to the given network address.
uint32_t first() const
Get the initial value for the next_run entry attribute.
_Entries & entries() const
Get a reference to the current object implementing the persistence API, for the device information...
Result
Commands result codes.
Response message payload for a Scheduling::GET_ENTRY_CMD request.
Helper class to handle the Number Of Entries attribute for the Event Scheduling service.
static constexpr uint16_t min_size
Minimum pack/unpack required data size.
HF::Attributes::IAttribute * create_attribute(HF::Core::AttributeReporting::IServer *server, uint8_t uid)
Create an attribute object that can hold the attribute with the given uid.
virtual ~IServer()
Destructor.
uint32_t step() const
Get the step between executions.
Top-level namespace for the HAN-FUN library.