Logo
Developing with ZBOSS for Zigbee
zb_zcl_time.h File Reference

Data Structures

struct  zb_zcl_time_attrs_s
 Time cluster attributes. More...
 

Macros

#define ZB_ZCL_TIME_SET_REAL_TIME_CLOCK_CB(func_ptr)   (zb_zcl_set_real_time_clock_callback((func_ptr)))
 Set user's callback that will be initialize real time clock on device by specified value. "If the Master bit of the @ref ZB_ZCL_ATTR_TIME_TIME_STATUS_ID "TimeStatus" attribute has a value of 0, writing to @ref ZB_ZCL_ATTR_TIME_TIME_ID "Time" attribute SHALL set the real time clock to the written value, otherwise it cannot be written.". More...
 
#define ZB_TIME_COMPARE_AUTH_LEVEL(new_level, new_short_addr, old_level, old_short_addr)
 
#define ZB_ZCL_TIME_TIME_STATUS_MASTER_BIT_IS_SET(val)   ((val) & (1 << ZB_ZCL_TIME_MASTER))
 
#define ZB_ZCL_TIME_TIME_STATUS_SYNCHRONIZED_BIT_IS_SET(val)   ((val) & (1 << ZB_ZCL_TIME_SYNCHRONIZED))
 
#define ZB_ZCL_TIME_TIME_STATUS_MASTER_ZONE_DST_BIT_IS_SET(val)   ((val) & (1 << ZB_ZCL_TIME_MASTER_ZONE_DST))
 
#define ZB_ZCL_TIME_TIME_STATUS_SUPERSEDING_BIT_IS_SET(val)   ((val) & (1 << ZB_ZCL_TIME_SUPERSEDING))
 
#define ZB_ZCL_TIME_CLUSTER_REVISION_DEFAULT   ((zb_uint16_t)0x0002u)
 Default value for Time cluster revision global attribute. More...
 
#define ZB_ZCL_TIME_TIME_INVALID_VALUE   ((zb_time_t)0xFFFFFFFF)
 Invalid value of Time attribute. More...
 
#define ZB_ZCL_TIME_TIME_DEFAULT_VALUE   ZB_ZCL_TIME_TIME_INVALID_VALUE
 Default value for Time attribute. More...
 
#define ZB_ZCL_TIME_TIME_MIN_VALUE   ((zb_time_t)0x0)
 Minimum value for Time attribute. More...
 
#define ZB_ZCL_TIME_TIME_MAX_VALUE   ((zb_time_t)0xFFFFFFFE)
 Maximum value for Time attribute. More...
 
#define ZB_ZCL_TIME_TIME_STATUS_DEFAULT_VALUE   0x00
 Default value for Time Status attribute. More...
 
#define ZB_ZCL_TIME_TIME_ZONE_DEFAULT_VALUE   0x00000000
 Default value for Time Zone attribute. More...
 
#define ZB_ZCL_TIME_DST_START_DEFAULT_VALUE   ((zb_uint32_t)0xFFFFFFFF)
 Default value for DstStart attribute. More...
 
#define ZB_ZCL_TIME_DST_END_DEFAULT_VALUE   ((zb_uint32_t)0xFFFFFFFF)
 Default value for DstEnd attribute. More...
 
#define ZB_ZCL_TIME_DST_SHIFT_DEFAULT_VALUE   0x00000000
 Default value for Dst Shift attribute. More...
 
#define ZB_ZCL_TIME_STANDARD_TIME_DEFAULT_VALUE   ((zb_uint32_t)0xFFFFFFFF)
 Default value for StandardTime attribute. More...
 
#define ZB_ZCL_TIME_LOCAL_TIME_DEFAULT_VALUE   ((zb_uint32_t)0xFFFFFFFF)
 Default value for LocalTime attribute. More...
 
#define ZB_ZCL_TIME_LAST_SET_TIME_DEFAULT_VALUE   0xffffffff
 Default value for Last Set Time attribute. More...
 
#define ZB_ZCL_TIME_VALID_UNTIL_TIME_DEFAULT_VALUE   0xffffffff
 Default value for Valid Until Time attribute. More...
 
#define ZB_ZCL_DECLARE_TIME_ATTRIB_LIST(attr_list, time, time_status, time_zone, dst_start, dst_end, dst_shift, standard_time, local_time, last_set_time, valid_until_time)
 Declare attribute list for Time cluster. More...
 
#define ZB_ZCL_DECLARE_TIME_ATTR_LIST(attr_list, attrs)
 Declare attribute list for Time cluster. More...
 
#define ZB_ZCL_CLUSTER_ID_TIME_SERVER_ROLE_INIT   zb_zcl_time_init_server
 
#define ZB_ZCL_CLUSTER_ID_TIME_CLIENT_ROLE_INIT   zb_zcl_time_init_client
 

Typedefs

typedef zb_bool_t(* zb_zcl_time_set_real_time_clock_t) (zb_uint32_t time)
 Set real time clock callback. More...
 
typedef void(* zb_zcl_time_sync_time_server_found_cb_t) (zb_ret_t status, zb_uint32_t auth_level, zb_uint16_t short_addr, zb_uint8_t ep, zb_uint32_t nw_time)
 Callback to call when new time server found during synchronization. More...
 
typedef struct zb_zcl_time_attrs_s zb_zcl_time_attrs_t
 

Enumerations

enum  zb_zcl_time_attr_e {
  ZB_ZCL_ATTR_TIME_TIME_ID = 0x0000, ZB_ZCL_ATTR_TIME_TIME_STATUS_ID = 0x0001, ZB_ZCL_ATTR_TIME_TIME_ZONE_ID = 0x0002, ZB_ZCL_ATTR_TIME_DST_START_ID = 0x0003,
  ZB_ZCL_ATTR_TIME_DST_END_ID = 0x0004, ZB_ZCL_ATTR_TIME_DST_SHIFT_ID = 0x0005, ZB_ZCL_ATTR_TIME_STANDARD_TIME_ID = 0x0006, ZB_ZCL_ATTR_TIME_LOCAL_TIME_ID = 0x0007,
  ZB_ZCL_ATTR_TIME_LAST_SET_TIME_ID = 0x0008, ZB_ZCL_ATTR_TIME_VALID_UNTIL_TIME_ID = 0x0009
}
 Time cluster attribute identifiers. More...
 
enum  zb_zcl_time_time_status_e { ZB_ZCL_TIME_MASTER = 0, ZB_ZCL_TIME_SYNCHRONIZED = 1, ZB_ZCL_TIME_MASTER_ZONE_DST = 2, ZB_ZCL_TIME_SUPERSEDING = 3 }
 Permissible values for Time Status attribute,. More...
 

Functions

void zb_zcl_time_server_synchronize (zb_uint8_t endpoint, zb_zcl_time_sync_time_server_found_cb_t cb)
 Start time synchronization. More...
 
zb_bool_t zb_zcl_time_server_read_attr_handle (zb_uint8_t param)
 Handle read attribute response for time cluster. More...
 
void zb_zcl_time_update_current_time (zb_uint8_t endpoint)
 
void zb_zcl_time_init_server (void)
 
void zb_zcl_time_init_client (void)
 

Macro Definition Documentation

§ ZB_ZCL_CLUSTER_ID_TIME_CLIENT_ROLE_INIT

#define ZB_ZCL_CLUSTER_ID_TIME_CLIENT_ROLE_INIT   zb_zcl_time_init_client

§ ZB_ZCL_CLUSTER_ID_TIME_SERVER_ROLE_INIT

#define ZB_ZCL_CLUSTER_ID_TIME_SERVER_ROLE_INIT   zb_zcl_time_init_server

Function Documentation

§ zb_zcl_time_init_client()

void zb_zcl_time_init_client ( void  )

§ zb_zcl_time_init_server()

void zb_zcl_time_init_server ( void  )

§ zb_zcl_time_update_current_time()

void zb_zcl_time_update_current_time ( zb_uint8_t  endpoint)

ZB_ZCL_TIME