HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::Scheduling::Weekly::IServer Struct Referenceabstract

Scheduling Service : Server side implementation. More...

#include <weekly_scheduling.h>

+ Inheritance diagram for HF::Core::Scheduling::Weekly::IServer:
+ Collaboration diagram for HF::Core::Scheduling::Weekly::IServer:

Public Member Functions

virtual Common::Result define_event (const Protocol::Packet &packet, Scheduling::Entry< Day > &msg)
 Callback that is called when a Scheduling::DEFINE_EVENT_CMD, is received. More...
 
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. More...
 
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. More...
 
virtual Common::Result delete_event (const Protocol::Packet &packet, const DeleteEvent &msg)
 Callback that is called when a Scheduling::DELETE_CMD, is received. More...
 
virtual Common::Result delete_all_events (const Protocol::Packet &packet)
 Callback that is called when a Scheduling::DELETE_ALL_CMD, is received. More...
 
 IServer (Unit0 &unit)
 Constructor.
 
virtual ~IServer ()
 Destructor.
 
virtual IEntries< Day > & entries () const =0
 Get a reference to the current object implementing the persistence API, for the device information. More...
 
Common::Pointer< Entryentry (const uint8_t id) const
 Get the Weekly Scheduling entry given by id. More...
 
uint8_t next_id () const
 Return next available id for event. More...
 
- Public Member Functions inherited from HF::Core::Service< _ITF, _Parent >
uint16_t uid () const
 This method returns the interface UID. More...
 

Additional Inherited Members

- Protected Member Functions inherited from HF::Core::Scheduling::Base< _ITF, _Parent >
 Base (Unit0 &unit)
 Constructor.
 
- Protected Member Functions inherited from HF::Core::Service< _ITF, _Parent >
 Service (Unit0 &unit)
 Constructor. More...
 
bool check_uid (uint16_t uid) const
 Check if the given uid value matches the service's UID value. More...
 

Detailed Description

Scheduling Service : Server side implementation.

This class provides the server side of the Scheduling interface.

Definition at line 363 of file weekly_scheduling.h.

Member Function Documentation

◆ define_event()

virtual Common::Result HF::Core::Scheduling::Weekly::IServer::define_event ( const Protocol::Packet packet,
Scheduling::Entry< Day > &  msg 
)
virtual

Callback that is called when a Scheduling::DEFINE_EVENT_CMD, is received.

Parameters
[in]packetthe packet received.
[in]msgthe define event message received.
Return values
Common::Result::OKif the entry was created;
Common::Result::FAIL_ARGif the entry ID already exists;
Common::Result::FAIL_RESOURCESif the entry could not be created;
Common::Result::FAIL_UNKNOWNotherwise.

◆ delete_all_events()

virtual Common::Result HF::Core::Scheduling::Weekly::IServer::delete_all_events ( const Protocol::Packet packet)
virtual

Callback that is called when a Scheduling::DELETE_ALL_CMD, is received.

Parameters
[in]packetthe packet received.
Return values
Common::Result::OK

◆ delete_event()

virtual Common::Result HF::Core::Scheduling::Weekly::IServer::delete_event ( const Protocol::Packet packet,
const DeleteEvent msg 
)
virtual

Callback that is called when a Scheduling::DELETE_CMD, is received.

Parameters
[in]packetthe packet received.
[in]msgthe delete event message received.
Return values
Common::Result::OKif the entry was deleted,
Common::Result::FAIL_ARGotherwise.

◆ entries()

virtual IEntries<Day>& HF::Core::Scheduling::Weekly::IServer::entries ( ) const
pure virtual

Get a reference to the current object implementing the persistence API, for the device information.

Returns
reference to the current object for the persistence API.

Implemented in HF::Core::Scheduling::Weekly::Server< _Entries >.

Referenced by entry(), and next_id().

+ Here is the caller graph for this function:

◆ entry()

Common::Pointer<Entry> HF::Core::Scheduling::Weekly::IServer::entry ( const uint8_t  id) const
inline

Get the Weekly Scheduling entry given by id.

Parameters
[in]idevent id of the event to retrieve.
Return values
pointerto the event entry if it exists,
nullptrotherwise.

Definition at line 470 of file weekly_scheduling.h.

References entries().

471  {
472  return entries().find(id);
473  }
virtual IEntries< Day > & entries() const =0
Get a reference to the current object implementing the persistence API, for the device information...
+ Here is the call graph for this function:

◆ get_event_entry()

virtual Common::Result HF::Core::Scheduling::Weekly::IServer::get_event_entry ( const Protocol::Packet packet,
const GetEntry msg 
)
virtual

Callback that is called when a Scheduling::GET_ENTRY_CMD, is received.

Parameters
[in]packetthe packet received.
[in]msgthe get event message received.
Return values
Common::Result::OKif the entry exists,
Common::Result::FAIL_ARGotherwise.

◆ next_id()

uint8_t HF::Core::Scheduling::Weekly::IServer::next_id ( ) const
inline

Return next available id for event.

Returns
the id to use in the next event, or Scheduler::Entry::AVAILABLE_ID if no id is available.

Definition at line 478 of file weekly_scheduling.h.

References entries().

479  {
480  return entries().next_id();
481  }
virtual IEntries< Day > & entries() const =0
Get a reference to the current object implementing the persistence API, for the device information...
+ Here is the call graph for this function:

◆ update_event_status()

virtual Common::Result HF::Core::Scheduling::Weekly::IServer::update_event_status ( const Protocol::Packet packet,
const UpdateStatus msg 
)
virtual

Callback that is called when a Scheduling::UPDATE_STATUS_CMD, is received.

Parameters
[in]packetthe packet received.
[in]msgthe update event status message received.
Return values
Common::Result::OKif the entry was updated;
Common::Result::FAIL_ARGif the entry does not exists;

The documentation for this struct was generated from the following file: