Data Structures | |
struct | ltrx_time |
Represents "broken-down" time. More... | |
struct | ltrx_time_source |
Represents a time source for registration. More... | |
Macros | |
#define | LTRX_EPOCH_YEAR 2000 |
Functions | |
uint32_t | ltrx_time_from_utc (struct ltrx_time *lt) |
Broken-down time to seconds. More... | |
uint32_t | ltrx_time_get (void) |
Get date and time. More... | |
void | ltrx_time_register_source (const struct ltrx_time_source *lts) |
Register a time source. More... | |
void | ltrx_time_set (uint32_t seconds_since_2000) |
Set date and time. More... | |
void | ltrx_time_to_local (uint32_t seconds_since_2000, struct ltrx_time *lt) |
Seconds to broken-down local time. More... | |
void | ltrx_time_to_utc (uint32_t seconds_since_2000, struct ltrx_time *lt) |
Seconds to broken-down GMT time. More... | |
#define LTRX_EPOCH_YEAR 2000 |
The Lantronix epoch is year 2000; this is the base value for the elapsed seconds to the current time for functions ltrx_time_get(), ltrx_time_set(), ltrx_time_to_utc() and ltrx_time_from_utc().
uint32_t ltrx_time_from_utc | ( | struct ltrx_time * | lt | ) |
Broken-down time to seconds.
Converts the broken-down time lt into seconds since year 2000. Also writes back lt in normal form.
No timezone adjustments are made.
[in,out] | lt | Structure with explicit calendar fields. |
uint32_t ltrx_time_get | ( | void | ) |
Get date and time.
Gets the number of seconds elapsed since the Lantronix epoch, January 1, 2000.
void ltrx_time_register_source | ( | const struct ltrx_time_source * | lts | ) |
Register a time source.
Registers a procedure into the system for setting and updating the time.
Registration must be done in early module initialization.
[in] | lts | Designates the procedures to start and stop this service. |
void ltrx_time_set | ( | uint32_t | seconds_since_2000 | ) |
Set date and time.
Sets the Real Time Clock (RTC) to number of seconds elapsed since the Lantronix epoch, January 1, 2000.
[in] | seconds_since_2000 | Number of seconds since January 1, 2000. |
void ltrx_time_to_local | ( | uint32_t | seconds_since_2000, |
struct ltrx_time * | lt | ||
) |
Seconds to broken-down local time.
Converts the calendar time seconds_since_2000 to broken-down time representation, expressed relative to the user's specified timezone.
[in] | seconds_since_2000 | Number of seconds since January 1, 2000. |
[out] | lt | Structure with explicit calendar fields. |
void ltrx_time_to_utc | ( | uint32_t | seconds_since_2000, |
struct ltrx_time * | lt | ||
) |
Seconds to broken-down GMT time.
Converts the calendar time seconds_since_2000 to broken-down time representation, expressed in Coordinated Universal Time (UTC).
[in] | seconds_since_2000 | Number of seconds since January 1, 2000. |
[out] | lt | Structure with explicit calendar fields. |