Digi XBee(R) ANSI C Host Library
time.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
10  * =======================================================================
11  */
20 #ifndef __XBEE_TIME_H
21 #define __XBEE_TIME_H
22 
23 #include <time.h>
24 #include "xbee/platform.h"
25 
27 
28 typedef uint32_t xbee_utctime_t;
29 #define XBEE_UTCTIME_INVALID 0xFFFFFFFF
30 
31 // Convert a 1/1/2000-based timestamp into a struct tm which can be used with
32 // the Standard C Library's <time.h>.
33 struct tm *xbee_gmtime(struct tm *tm, xbee_utctime_t timestamp);
34 
35 // Convert a struct tm to a 1/1/2000-based timestamp.
36 xbee_utctime_t xbee_mktime(struct tm *time_rec);
37 
39 
40 // If compiling in Dynamic C, automatically #use the appropriate C file.
41 #ifdef __DC__
42  #use "xbee_time.c"
43 #endif
44 
45 #endif // __XBEE_TIME_H defined
46 
unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
Common header for Hardware Abstraction Layer.
struct tm * xbee_gmtime(struct tm *tm, xbee_utctime_t timestamp)
Converts a UTCTime value into a "broken-down time" (a struct tm) for directly accessing month...
Definition: xbee_time.c:82
xbee_utctime_t xbee_mktime(struct tm *time_rec)
Convert a struct tm (from the Standard C Library&#39;s time.h) to a xbee_utctime_t type (number of second...
Definition: xbee_time.c:198
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42