|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Access monotonic uptime and the badge real-time clock. More...
Classes | |
| struct | host_tm |
Functions | |
| uint64_t | host_uptime_ms (void) |
| Monotonic milliseconds since boot. | |
| int64_t | host_unix_time (void) |
| Current Unix timestamp in seconds, or 0 if RTC not set. | |
| int | host_local_time (struct host_tm *out) |
| Fill out with the current local time broken into fields. | |
| int32_t | host_timezone_offset (void) |
| Configured timezone offset from UTC in seconds. | |
| bool | host_is_time_set (void) |
| True when the RTC has been synchronised at least once. | |
Access monotonic uptime and the badge real-time clock.
Use host_uptime_ms for elapsed-time measurements; use the wall-clock helpers (host_unix_time, host_local_time) only after checking host_is_time_set.
| bool host_is_time_set | ( | void | ) |
True when the RTC has been synchronised at least once.
Definition at line 28 of file host_api_time.cpp.
References getRtcInstance().
Referenced by cdc::plugin_manager::w_host_is_time_set().
| int host_local_time | ( | struct host_tm * | out | ) |
Fill out with the current local time broken into fields.
Definition at line 40 of file host_api_time.cpp.
References host_tm::day, getRtcInstance(), HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, host_tm::hour, host_tm::minute, host_tm::month, host_tm::second, host_tm::weekday, and host_tm::year.
Referenced by cdc::plugin_manager::w_host_local_time().
| int32_t host_timezone_offset | ( | void | ) |
Configured timezone offset from UTC in seconds.
Definition at line 34 of file host_api_time.cpp.
References getRtcInstance().
Referenced by cdc::plugin_manager::w_host_timezone_offset().
| int64_t host_unix_time | ( | void | ) |
Current Unix timestamp in seconds, or 0 if RTC not set.
Definition at line 22 of file host_api_time.cpp.
References getRtcInstance().
Referenced by cdc::plugin_manager::w_host_unix_time().
| uint64_t host_uptime_ms | ( | void | ) |
Monotonic milliseconds since boot.
Definition at line 17 of file host_api_time.cpp.
Referenced by cdc::plugin_manager::w_host_uptime_ms().