LOGGER
Logger
Data Logging using ESP8266
|
#include <arduino.h>
#include "basetype.h"
Go to the source code of this file.
Macros | |
#define | timeservicesHedit 2 |
version of this include file | |
Functions | |
void | timeservicesInit () |
Initialize time services, call once at system startup. | |
void | timeservicesLoop () |
time_t | timeServicesGetNTPtime () |
String | timeservicesDumpTime (time_t t) |
void | dumpAmountOfTime (Print *pPrint, time_t seconds) |
EXTERNDEF void | dumpAmountOfTimeMS (Print *pPrint, uint32_t milliAmount) |
bool | timeservicesTimeIsValid () |
void | timeservicesConfigurationPage () |
display the time configuration page | |
Variables | |
bool | timeservicesTimeWasManuallySet |
Set to true if time was set by a console command. More... | |
bool | timeservicesReportRequired |
NTP time service routines
void dumpAmountOfTime | ( | Print * | pPrint, |
time_t | seconds | ||
) |
Dump an amount of time
pPrint | where to output the time |
seconds | amount of time to dump |
EXTERNDEF void dumpAmountOfTimeMS | ( | Print * | pPrint, |
uint32_t | milliAmount | ||
) |
Dump an amount of time
pPrint | where to output the time |
milliAmount | amount of time to dump in ms |
String timeservicesDumpTime | ( | time_t | t | ) |
Convert a UNIX time to a string
t | time to convert |
time_t timeServicesGetNTPtime | ( | ) |
Fetch time from an NTP server
Send an NTP packet and wait for the response, return the Unix time
To lower the memory footprint, no buffers are allocated for sending and receiving the NTP packets. Four bytes of memory are allocated for transmision, the rest is random garbage collected from the data memory segment, and the received packet is read one byte at a time. The Unix time is returned, that is, seconds from 1970-01-01T00:00.
void timeservicesLoop | ( | ) |
Perform periodic tasks managing timeservices. Call frequently as the system runs. Does not block.
bool timeservicesTimeIsValid | ( | ) |
Determine if time has a valid value. Time might be set manually or retrieved from the web.
bool timeservicesReportRequired |
Set this flag to trigger a time report. Safe to set in an ISR.
bool timeservicesTimeWasManuallySet |
Set to true if time was set by a console command.
Set to true when time is set by a console command. This gets reset if the time is automatically set from the web.