MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
Public Member Functions | List of all members
Timer Class Reference

Timer that syncs with NTP server. More...

#include <timer.h>

Public Member Functions

 Timer ()
 
tm get_utc_time ()
 Get the utc time now. More...
 
time_t get_epoch_time ()
 Get the seconds since epoch now. More...
 
void print_utc_time ()
 Print the seconds since epoch. More...
 
void begin (long int sync_interval_ms=600000)
 initialise the timer, set a sync interval to sync with NTP server More...
 

Detailed Description

Timer that syncs with NTP server.

Definition at line 26 of file timer.h.

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( )

Definition at line 26 of file timer.cpp.

Member Function Documentation

◆ begin()

void Timer::begin ( long int  sync_interval_ms = 600000)

initialise the timer, set a sync interval to sync with NTP server

Parameters
sync_interval_mssync interval in milliseconds

Definition at line 52 of file timer.cpp.

◆ get_epoch_time()

time_t Timer::get_epoch_time ( )

Get the seconds since epoch now.

Returns
time_t

Definition at line 38 of file timer.cpp.

◆ get_utc_time()

tm Timer::get_utc_time ( )

Get the utc time now.

Returns
tm

Definition at line 28 of file timer.cpp.

◆ print_utc_time()

void Timer::print_utc_time ( )

Print the seconds since epoch.

Definition at line 44 of file timer.cpp.


The documentation for this class was generated from the following files: