XBee Firmware Library  1.6.0
Files | Functions | Variables
Xbee_time

Files

file  time.h
 
file  xbee_time.c
 

Functions

void _xbee_mktime_normalize (int *major, int *minor, int count)
 
struct tm * xbee_gmtime (struct tm *dest_tm, xbee_utctime_t timestamp)
 Converts a UTCTime value into a "broken-down time" (a struct tm) for directly accessing month, day, year, hour, minute and second, or for use with other functions from <time.h>. More...
 
xbee_utctime_t xbee_mktime (struct tm *time_rec)
 Convert a struct tm (from the Standard C Library's time.h) to a xbee_utctime_t type (number of seconds since Midnight January 1, 2000 UTC). More...
 

Variables

const uint8_t _xbee_time_dom [2][12]
 
const uint16_t _xbee_time_jom [2][12]
 
XBEE_BEGIN_DECLS typedef uint32_t xbee_utctime_t
 

Detailed Description

Function Documentation

void _xbee_mktime_normalize ( int *  major,
int *  minor,
int  count 
)
struct tm * xbee_gmtime ( struct tm *  dest_tm,
xbee_utctime_t  timestamp 
)

Converts a UTCTime value into a "broken-down time" (a struct tm) for directly accessing month, day, year, hour, minute and second, or for use with other functions from <time.h>.

Parameters
[out]dest_tmDestination "struct tm" structure to hold the broken-down time. See time.h for details on that structure.
[in]timestampTimestamp to convert. Number of seconds since 1/1/2000 UTC.
Returns
Returns the dest_tm parameter.
xbee_utctime_t xbee_mktime ( struct tm *  time_rec)

Convert a struct tm (from the Standard C Library's time.h) to a xbee_utctime_t type (number of seconds since Midnight January 1, 2000 UTC).

Does NOT properly handle DST and Timezones in the struct tm. Assumes the struct is in UTC. Keep this in mind if passing a struct tm generated by the host's gmtime() to this function.

Parameters
[in]time_recbroken-down (componentized) calendar representation of time
Returns
number of seconds since 01/01/2000 00:00:00 UTC or XBEE_UTCTIME_INVALID if time_rec is before 1/1/2000

Handle DST and time zones.

Variable Documentation

const uint8_t _xbee_time_dom
Initial value:
=
{
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
}
const uint16_t _xbee_time_jom
Initial value:
=
{
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334},
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}
}
XBEE_BEGIN_DECLS typedef uint32_t xbee_utctime_t