/* SPDX-License-Identifier: MIT Copyright (c) 2023 John Watts and the LuminaSensum contributors */ #ifndef CLOCK_H #define CLOCK_H #include "NetworkInterface.h" #include "sntp.h" #include <chrono> #include <time.h> struct timeval microseconds_to_timeval(std::chrono::microseconds val); std::chrono::microseconds timeval_to_microseconds(struct timeval val); void clock_setup(void); std::chrono::microseconds clock_time(void); SNTPError clock_sync(NetworkInterface &net); const char *clock_timestring(struct timeval time, const char *format); const char *clock_iso8601string(void); #endif