access the Pocuter real time clock
More...
#include <PocuterTime.h>
access the Pocuter real time clock
◆ TIMEERROR
| Enumerator |
|---|
| TIMEERROR_OK | |
| TIMEERROR_FAILED | |
| TIMEERROR_UNKNOWN | |
◆ getAllTimezones()
get all available timezones
- Parameters
-
| tz | (out) a pointer to an array. You must not allocate memory for this. |
| count | (out) a pointer to an uint16_t. The number of array elements will be set here. |
- Returns
- TIMEERROR_OK
◆ getCurrentTimezone()
| virtual const char* PocuterTime::getCurrentTimezone |
( |
| ) |
|
|
pure virtual |
get the current time zone
- Returns
- const char* a zero terminated string, the name of the timezone
◆ getGMTTime()
| virtual TIMEERROR PocuterTime::getGMTTime |
( |
tm * |
time | ) |
|
|
pure virtual |
get the gmt time as tm struct.
- Parameters
-
| time | (out) a pointer to the time struct |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ getLocalTime()
| virtual TIMEERROR PocuterTime::getLocalTime |
( |
tm * |
time | ) |
|
|
pure virtual |
get the local time as tm struct.
- Parameters
-
| time | (out) a pointer to the time struct |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ getTimeServer()
| virtual const char* PocuterTime::getTimeServer |
( |
| ) |
|
|
pure virtual |
get the current time server address
- Returns
- const char* a zero terminated string, the name of the timezone
◆ isTimeServer()
| virtual bool PocuterTime::isTimeServer |
( |
| ) |
|
|
pure virtual |
request if a timeserver connection was activated
- Returns
- true / false
◆ setLocalTime()
| virtual TIMEERROR PocuterTime::setLocalTime |
( |
tm * |
time | ) |
|
|
pure virtual |
set the local time
- Parameters
-
| time | a pointer to the time struct with the local time |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ setTimeServer() [1/2]
| virtual TIMEERROR PocuterTime::setTimeServer |
( |
bool |
on | ) |
|
|
pure virtual |
activate / deactivate the timeserver connection
- Parameters
-
| on | activate / deactivate the timeserver connection |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ setTimeServer() [2/2]
| virtual TIMEERROR PocuterTime::setTimeServer |
( |
const char * |
timeServer | ) |
|
|
pure virtual |
set the address of the time server
- Parameters
-
| timeServer | a string with the timeserver ( "pool.ntp.org" for example ) |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ setTimezone()
changes the time zone
- Parameters
-
| tz | a pointer to the timezone you want to use |
| save | (optional) if true, the time zone is stored on the SDCard. Therefore it will still be set after a reboot. |
- Returns
- TIMEERROR_OK everything works well
- TIMEERROR_FAILED could not set the timezone
◆ c_tz
The documentation for this class was generated from the following file: