Digi XBee(R) ANSI C Host Library
Macros | Functions | Variables

Header for implementation of ZigBee Time Cluster (ZCL Spec section 3.12). More...

#include <time.h>
#include "zigbee/zcl.h"

Go to the source code of this file.

Macros

#define zcl_gmtime(tm, timestamp)   xbee_gmtime( tm, timestamp)
 
#define zcl_mktime(tm)   xbee_mktime( tm)
 
#define ZCL_CLUST_ENTRY_TIME_BOTH
 Macro for inserting a standard Time Server (and Client) into an endpoint's cluster list. More...
 
#define ZCL_CLUST_ENTRY_TIME_SERVER
 Macro for inserting a standard Time Server (no Client) into an endpoint's cluster list. More...
 
#define ZCL_CLUST_ENTRY_TIME_CLIENT
 Macro for inserting a standard Time Client (no Server) into an endpoint's cluster list. More...
 

Functions

zcl_utctime_t zcl_time_now (void)
 Returns the current date/time, using the ZCL epoch of January 1, 2000. More...
 
int zcl_time_client (const wpan_envelope_t FAR *envelope, void FAR *context)
 Handle Read Attribute Responses to requests sent as part of the zcl_time_find_servers() process. More...
 
int zcl_time_find_servers (wpan_dev_t *dev, uint16_t profile_id)
 Find Time Servers on the network, query them for the current time and then synchronize this device's clock to that time. More...
 

Variables

const zcl_attribute_tree_t zcl_time_attribute_tree []
 

Attributes of ZCL Time Cluster

#define ZCL_TIME_ATTR_TIME   0x0000
 3.12.2.2.1 Time Attribute
 
#define ZCL_TIME_ATTR_TIME_STATUS   0x0001
 3.12.2.2.2 TimeStatus Attribute
 
#define ZCL_TIME_ATTR_TIME_ZONE   0x0002
 3.12.2.2.3 TimeZone Attribute
 
#define ZCL_TIME_ATTR_DST_START   0x0003
 3.12.2.2.4 DstStart Attribute
 
#define ZCL_TIME_ATTR_DST_END   0x0004
 3.12.2.2.5 DstEnd Attribute
 
#define ZCL_TIME_ATTR_DST_SHIFT   0x0005
 3.12.2.2.6 DstShift Attribute
 
#define ZCL_TIME_ATTR_STANDARD_TIME   0x0006
 3.12.2.2.7 StandardTime Attribute
 
#define ZCL_TIME_ATTR_LOCAL_TIME   0x0007
 3.12.2.2.8 LocalTime Attribute
 

Bitfields for attribute ZCL_TIME_ATTR_TIME, TimeStatus.

Bits 3-7 are reserved.

Per Section 3.12.2.2.2 of the ZCL spec:

  • If the Master bit is 1, the value of [the Synchronized bit] is 0.
  • If both the Master and Synchronized bits are 0, the real time clock has no defined relationship to the time standard.
#define ZCL_TIME_STATUS_MASTER   0x01
 The RTC corresponding to the Time attribute is internally set to the time standard. More...
 
#define ZCL_TIME_STATUS_SYNCHRONIZED   0x02
 The Synchronized bit specifies whether Time has been set over the [ZigBee] network to synchronize it (as close as may be practical) to the time standard (see 3.12.1). More...
 
#define ZCL_TIME_STATUS_MASTERZONEDST   0x04
 The MasterZoneDst bit specifies whether the TimeZone, DstStart, DstEnd and DstShift attributes are set internally to correct values for the location of the clock. More...
 

Detailed Description

Header for implementation of ZigBee Time Cluster (ZCL Spec section 3.12).

Numbers in comments refer to sections of ZigBee Cluster Library specification (Document 075123r02ZB).