Specific part for the Weekly Scheduler of the HF::Scheduling::Entry
.
More...
#include <weekly_scheduling.h>
|
uint32_t | first (uint32_t timestamp=0) const |
| Get the initial value for the next_run entry attribute. More...
|
|
uint32_t | step () const |
| Get the step between executions. More...
|
|
bool | active (uint32_t _time) const |
|
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...
|
|
|
static constexpr uint16_t | min_size |
| Minimum pack/unpack required data size.
|
|
Specific part for the Weekly Scheduler of the HF::Scheduling::Entry
.
Definition at line 83 of file weekly_scheduling.h.
◆ active()
bool HF::Core::Scheduling::Weekly::Day::active |
( |
uint32_t |
_time | ) |
const |
|
inline |
- Parameters
-
- Returns
Definition at line 164 of file weekly_scheduling.h.
References UNUSED.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
◆ first()
uint32_t HF::Core::Scheduling::Weekly::Day::first |
( |
uint32_t |
timestamp = 0 | ) |
const |
|
inline |
Get the initial value for the next_run entry attribute.
- Parameters
-
[in] | timestamp | the current system time. |
- Returns
- the timestamp for the first run.
Definition at line 130 of file weekly_scheduling.h.
References day, hour, and minute.
132 uint32_t result = timestamp;
134 Day current(convert(timestamp));
136 result += (this->
hour - current.hour) * 60 * 60;
137 result += (this->
minute - current.minute) * 60;
139 result += (this->
day - current.day) * 24 * 60 * 60;
141 if (timestamp > result)
uint8_t minute
Minute of Hour.
◆ pack()
uint16_t HF::Core::Scheduling::Weekly::Day::pack |
( |
Common::ByteArray & |
array, |
|
|
uint16_t |
offset = 0 |
|
) |
| const |
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.,
Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
- Parameters
-
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
- Returns
- the number of bytes written.
◆ size()
uint16_t HF::Core::Scheduling::Weekly::Day::size |
( |
| ) |
const |
|
inline |
Number bytes needed to serialize the message.
- Returns
- number of bytes the message requires to be serialized.
Definition at line 176 of file weekly_scheduling.h.
References min_size.
static constexpr uint16_t min_size
Minimum pack/unpack required data size.
◆ step()
uint32_t HF::Core::Scheduling::Weekly::Day::step |
( |
void |
| ) |
const |
|
inline |
◆ unpack()
uint16_t HF::Core::Scheduling::Weekly::Day::unpack |
( |
const Common::ByteArray & |
array, |
|
|
uint16_t |
offset = 0 |
|
) |
| |
Read a message from a ByteArray.
- Parameters
-
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
- Returns
- the number of bytes read.
◆ day
uint8_t HF::Core::Scheduling::Weekly::Day::day |
◆ hour
uint8_t HF::Core::Scheduling::Weekly::Day::hour |
◆ minute
uint8_t HF::Core::Scheduling::Weekly::Day::minute |
The documentation for this struct was generated from the following file: