NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
Synchronized Scheduler for timed message sending. More...
#include <N2kTimer.h>
Public Member Functions | |
tN2kSyncScheduler (bool Enable=false, uint32_t _Period=0, uint32_t _Offset=0) | |
Constructor for sync scheduler. More... | |
void | Disable () |
Disable Scheduler. More... | |
uint64_t | GetNextTime () const |
Get the Timestamp of the NextTime. More... | |
uint32_t | GetOffset () const |
Get the Offset of the Scheduler. More... | |
uint32_t | GetPeriod () const |
Get the Period of the Scheduler. More... | |
bool | IsDisabled () const |
Checks if Scheduler is disabled. More... | |
bool | IsEnabled () const |
Checks if Scheduler is enabled. More... | |
bool | IsTime () |
Check if ít is time. More... | |
uint64_t | Remaining () |
Calculate remaining time. More... | |
void | SetOffset (uint32_t _Offset) |
Set the Offset of the Scheduler. More... | |
void | SetPeriod (uint32_t _Period) |
Set the Period of the Scheduler. More... | |
void | SetPeriodAndOffset (uint32_t _Period, uint32_t _Offset) |
Set the Period And Offset of the Scheduler. More... | |
void | UpdateNextTime () |
Update the timestamp for NextTime. More... | |
Static Public Member Functions | |
static void | SetSyncOffset () |
Set the SyncOffset of the scheduler. More... | |
Protected Attributes | |
uint64_t | NextTime |
Timestamp for next event. More... | |
uint32_t | Offset |
Offset to synchronize with others. More... | |
uint32_t | Period |
Period for scheduler. More... | |
Static Protected Attributes | |
static uint64_t | SyncOffset =0 |
??? More... | |
Synchronized Scheduler for timed message sending.
tN2kSyncScheduler is meant to use for timed message sending. Each messages has defined offset and period, which can be maintained by request group function. tN2kSyncScheduler uses 64 bit millisecond time to prevent it ever roll over. Offset synchronizes with other schedulers.
Definition at line 124 of file N2kTimer.h.
|
inline |
Constructor for sync scheduler.
This function initializes all parameters.
Enable | default = false |
_Period | Period [ms] of the scheduler, default = 0 |
_Offset | Offset [ms] of the scheduler, default = 0 |
Definition at line 145 of file N2kTimer.h.
|
inline |
Disable Scheduler.
Definition at line 157 of file N2kTimer.h.
|
inline |
Get the Timestamp of the NextTime.
Definition at line 236 of file N2kTimer.h.
|
inline |
Get the Offset of the Scheduler.
Definition at line 222 of file N2kTimer.h.
|
inline |
Get the Period of the Scheduler.
Definition at line 229 of file N2kTimer.h.
|
inline |
Checks if Scheduler is disabled.
Definition at line 165 of file N2kTimer.h.
|
inline |
Checks if Scheduler is enabled.
Definition at line 173 of file N2kTimer.h.
|
inline |
Check if ít is time.
Definition at line 181 of file N2kTimer.h.
|
inline |
Calculate remaining time.
Definition at line 188 of file N2kTimer.h.
|
inline |
Set the Offset of the Scheduler.
_Offset | Offset in [ms] of the Scheduler |
Definition at line 202 of file N2kTimer.h.
|
inline |
Set the Period of the Scheduler.
_Period | Period in [ms] of the Scheduler |
Definition at line 195 of file N2kTimer.h.
|
inline |
Set the Period And Offset of the Scheduler.
_Period | Period in [ms] of the Scheduler |
_Offset | Offset in [ms] of the Scheduler |
Definition at line 210 of file N2kTimer.h.
|
inlinestatic |
Set the SyncOffset of the scheduler.
Definition at line 259 of file N2kTimer.h.
|
inline |
Update the timestamp for NextTime.
Definition at line 242 of file N2kTimer.h.
|
protected |
Timestamp for next event.
Definition at line 129 of file N2kTimer.h.
|
protected |
Offset to synchronize with others.
Definition at line 131 of file N2kTimer.h.
|
protected |
Period for scheduler.
Definition at line 133 of file N2kTimer.h.
|
staticprotected |
???
Definition at line 127 of file N2kTimer.h.