![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Base class for scheduling services entries. More...
#include <scheduling.h>
Public Member Functions | |
Entry (uint8_t _id, uint8_t _status, _Type _t, uint8_t _pid) | |
Constructor. More... | |
bool | active (uint32_t _time) const |
Check if the current entry is runnable at _time. More... | |
void | step (void) |
Increment the next_run attribute. | |
uint16_t | size () const |
Number bytes needed to serialize the message. More... | |
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. More... | |
uint16_t | unpack (const Common::ByteArray &array, uint16_t offset=0) |
Read a message from a ByteArray. More... | |
Data Fields | |
uint8_t | id |
Event ID. More... | |
bool | status |
Event Status. More... | |
_Type | time |
Scheduler configuration. More... | |
uint8_t | pid |
Program ID to be invoked. More... | |
uint32_t | next_run |
Next run timestamp. More... | |
Static Public Attributes | |
static constexpr uint16_t | START_ID = 0x00 |
Lower bound for the entries ID. More... | |
static constexpr uint16_t | MAX_ID = 0xFE |
Upper bound for the entries ID. More... | |
static constexpr uint16_t | AVAILABLE_ID = 0xFF |
Special ID for system allocated ID. More... | |
static constexpr uint16_t | min_size |
Minimum pack/unpack required data size. | |
Base class for scheduling services entries.
_Type | the specific data for scheduling service entry. |
Definition at line 175 of file scheduling.h.
|
inline |
Constructor.
[in] | _id | the entry ID. |
[in] | _status | the entry status. |
[in] | _t | the specific data for the scheduling service. |
[in] | _pid | the batch program ID to be run. |
Definition at line 193 of file scheduling.h.
|
inline |
Check if the current entry is runnable at _time.
[in] | _time | the system time. |
false | if the entry can't run. |
true | if the entry can run. |
Definition at line 211 of file scheduling.h.
References HF::Core::Scheduling::Entry< _Type >::next_run, HF::Core::Scheduling::Entry< _Type >::status, and HF::Core::Scheduling::Entry< _Type >::time.
|
inline |
Write the object on to a ByteArray so it can be sent over the network.
The buffer passed in MUST have enough size to hold the serialized object, e.g.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
Definition at line 239 of file scheduling.h.
References HF_SERIALIZABLE_CHECK, HF::Core::Scheduling::Entry< _Type >::pid, HF::Core::Scheduling::Entry< _Type >::size(), HF::Core::Scheduling::Entry< _Type >::status, HF::Core::Scheduling::Entry< _Type >::time, and HF::Common::ByteArray::write().
|
inline |
Number bytes needed to serialize the message.
Definition at line 233 of file scheduling.h.
References HF::Core::Scheduling::Entry< _Type >::min_size.
Referenced by HF::Core::Scheduling::Entry< _Type >::pack(), and HF::Core::Scheduling::Entry< _Type >::unpack().
|
inline |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Definition at line 254 of file scheduling.h.
References HF_ASSERT, HF_SERIALIZABLE_CHECK, HF::Core::Scheduling::Entry< _Type >::min_size, HF::Core::Scheduling::Entry< _Type >::pid, HF::Common::ByteArray::read(), HF::Core::Scheduling::Entry< _Type >::size(), HF::Core::Scheduling::Entry< _Type >::status, and HF::Core::Scheduling::Entry< _Type >::time.
|
static |
Special ID for system allocated ID.
Definition at line 201 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entries< _Type >::next_id().
uint8_t HF::Core::Scheduling::Entry< _Type >::id |
Event ID.
(Unique per device)
Definition at line 177 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entries< _Type >::destroy(), and HF::Core::Scheduling::Entries< _Type >::save().
|
static |
Upper bound for the entries ID.
Definition at line 200 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entries< _Type >::next_id().
uint32_t HF::Core::Scheduling::Entry< _Type >::next_run |
Next run timestamp.
Definition at line 183 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entry< _Type >::active(), and HF::Core::Scheduling::Entry< _Type >::step().
uint8_t HF::Core::Scheduling::Entry< _Type >::pid |
Program ID to be invoked.
Definition at line 180 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entry< _Type >::pack(), and HF::Core::Scheduling::Entry< _Type >::unpack().
|
static |
Lower bound for the entries ID.
Definition at line 199 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entries< _Type >::next_id().
bool HF::Core::Scheduling::Entry< _Type >::status |
Event Status.
Definition at line 178 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entry< _Type >::active(), HF::Core::Scheduling::Entry< _Type >::pack(), and HF::Core::Scheduling::Entry< _Type >::unpack().
_Type HF::Core::Scheduling::Entry< _Type >::time |
Scheduler configuration.
Definition at line 179 of file scheduling.h.
Referenced by HF::Core::Scheduling::Entry< _Type >::active(), HF::Core::Scheduling::Entry< _Type >::pack(), HF::Core::Scheduling::Entry< _Type >::step(), and HF::Core::Scheduling::Entry< _Type >::unpack().