|
Anjay Lite
|
Platform compatibility hooks for obtaining current time. More...
Go to the source code of this file.
Functions | |
| anj_time_monotonic_t | anj_time_monotonic_now (void) |
| Returns the current monotonic time point. | |
| anj_time_real_t | anj_time_real_now (void) |
| Returns the current real (calendar) time point. | |
Platform compatibility hooks for obtaining current time.
This header declares a minimal API that platform integrators (or end users) can implement to provide current time to Anjay Lite:
The concrete implementation is platform-specific and may live in the application, BSP, or OS abstraction layer. The returned values use the same types and semantics as defined in anj/time.h.
| anj_time_monotonic_t anj_time_monotonic_now | ( | void | ) |
Returns the current monotonic time point.
The result is a time point measured from an arbitrary monotonic epoch (typically system boot) and must not be affected by wall-clock adjustments such as NTP synchronization, time zone changes, or manual edits. Resolution is platform-dependent.
The monotonic clock used by Anjay Lite must never stop or go backwards: it needs to be a continuously advancing time base even if the system enters sleep/suspend. If the platform's default monotonic clock stops across suspend, use a clock source that continues counting (or implement sleep-time compensation).
| anj_time_real_t anj_time_real_now | ( | void | ) |
Returns the current real (calendar) time point.
The result is referenced to the Unix epoch (00:00:00 UTC on 1970-01-01)) and may be affected by wall-clock adjustments (NTP corrections or manual edits).