4.2.0.0R6
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
Date and Time

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...
 

Detailed Description

Macro Definition Documentation

#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().

Function Documentation

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.

Returns
Seconds since year 2000.
Parameters
[in,out]ltStructure 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.

Returns
Number of seconds since 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.

Parameters
[in]ltsDesignates 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.

Parameters
[in]seconds_since_2000Number 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.

Parameters
[in]seconds_since_2000Number of seconds since January 1, 2000.
[out]ltStructure 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).

Parameters
[in]seconds_since_2000Number of seconds since January 1, 2000.
[out]ltStructure with explicit calendar fields.