|
EnigmaIOT
0.9.3
Secure sensor and gateway platform based on ESP8266 and ESP32
|
#include <timeManager.h>
Public Member Functions | |
| int64_t | setOrigin () |
| Inits time synchronization getting local clock to be assigned to T1. More... | |
| int64_t | clock () |
Gets local clock. It returns millis() if not synchronized, local clock otherwise. More... | |
| time_t | unixtime () |
Gets local clock in seconds. It returns millis() / 1000 if not synchronized, local clock otherwise. This may contain current realtime clock if Gateway is synchronized using NTP time. More... | |
| int64_t | adjustTime (int64_t t1r, int64_t t2r, int64_t t3r, int64_t t4r) |
| Gets delay between Gateway time and local clock and adjust local clock accordingly. It uses same procedure as SNTP protocol. More... | |
| int64_t | getOffset () |
| Gets current offset to calculate clock, in milliseconds. More... | |
| bool | isTimeAdjusted () |
| Gets synchronization status. More... | |
| int64_t | getDelay () |
| Gets propagation + processing delay between Node and Gateway in milliseconds. More... | |
| void | reset () |
| Resets clock synchronization and sets values to initial status. More... | |
Protected Attributes | |
| bool | timeIsAdjusted = false |
| Indicates if time has been synchronized. More... | |
| int64_t | offset = 0 |
Offet between node millis() and gateway time. More... | |
| int64_t | roundTripDelay |
| Propagation delay between Node and Gateway. More... | |
Definition at line 14 of file timeManager.h.
| int64_t TimeManagerClass::adjustTime | ( | int64_t | t1r, |
| int64_t | t2r, | ||
| int64_t | t3r, | ||
| int64_t | t4r | ||
| ) |
Gets delay between Gateway time and local clock and adjust local clock accordingly. It uses same procedure as SNTP protocol.
| t1r | T1 |
| t2r | T2 |
| t3r | T3 |
| t4r | T4 |
Definition at line 30 of file timeManager.cpp.
| int64_t TimeManagerClass::clock | ( | ) |
Gets local clock. It returns millis() if not synchronized, local clock otherwise.
Definition at line 20 of file timeManager.cpp.
|
inline |
Gets propagation + processing delay between Node and Gateway in milliseconds.
Definition at line 74 of file timeManager.h.
|
inline |
Gets current offset to calculate clock, in milliseconds.
Definition at line 58 of file timeManager.h.
|
inline |
Gets synchronization status.
True if clock is synchronized Definition at line 66 of file timeManager.h.
|
inline |
Resets clock synchronization and sets values to initial status.
Definition at line 81 of file timeManager.h.
| int64_t TimeManagerClass::setOrigin | ( | ) |
Inits time synchronization getting local clock to be assigned to T1.
Definition at line 12 of file timeManager.cpp.
|
inline |
Gets local clock in seconds. It returns millis() / 1000 if not synchronized, local clock otherwise. This may contain current realtime clock if Gateway is synchronized using NTP time.
Definition at line 39 of file timeManager.h.
|
protected |
Offet between node millis() and gateway time.
Definition at line 18 of file timeManager.h.
|
protected |
Propagation delay between Node and Gateway.
Definition at line 19 of file timeManager.h.
|
protected |
Indicates if time has been synchronized.
Definition at line 17 of file timeManager.h.
1.8.18