diff options
Diffstat (limited to 'Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h')
-rw-r--r-- | Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h index 0ea5f7df0..aab7aa692 100644 --- a/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h +++ b/Middlewares/ST/STM32_WPAN/zigbee/stack/include/zcl/zcl.time.h @@ -1,4 +1,10 @@ -/* Copyright [2009 - 2020] Exegin Technologies Limited. All rights reserved. */ +/** + * @file zcl.time.h + * @brief ZCL Time cluster header + * ZCL 7 section 3.12 + * ZCL 8 section 3.12 + * @copyright Copyright [2009 - 2020] Exegin Technologies Limited. All rights reserved. + */ #ifndef ZCL_TIME_H # define ZCL_TIME_H @@ -38,16 +44,16 @@ /** Time Server Attribute IDs */ enum ZbZclTimeSvrAttrT { - ZCL_TIME_ATTR_TIME = 0x0000, - ZCL_TIME_ATTR_STATUS = 0x0001, - ZCL_TIME_ATTR_TIME_ZONE = 0x0002, - ZCL_TIME_ATTR_DST_START = 0x0003, - ZCL_TIME_ATTR_DST_END = 0x0004, - ZCL_TIME_ATTR_DST_SHIFT = 0x0005, - ZCL_TIME_ATTR_STANDARD_TIME = 0x0006, - ZCL_TIME_ATTR_LOCAL_TIME = 0x0007, - ZCL_TIME_ATTR_LAST_SET_TIME = 0x0008, - ZCL_TIME_ATTR_VALID_UNTIL_TIME = 0x0009 + ZCL_TIME_ATTR_TIME = 0x0000, /**< Time */ + ZCL_TIME_ATTR_STATUS = 0x0001, /**< TimeStatus */ + ZCL_TIME_ATTR_TIME_ZONE = 0x0002, /**< TimeZone (Optional) */ + ZCL_TIME_ATTR_DST_START = 0x0003, /**< DstStart (Optional) */ + ZCL_TIME_ATTR_DST_END = 0x0004, /**< DstEnd (Optional) */ + ZCL_TIME_ATTR_DST_SHIFT = 0x0005, /**< DstShift (Optional) */ + ZCL_TIME_ATTR_STANDARD_TIME = 0x0006, /**< StandardTime (Optional) */ + ZCL_TIME_ATTR_LOCAL_TIME = 0x0007, /**< LocalTime (Optional) */ + ZCL_TIME_ATTR_LAST_SET_TIME = 0x0008, /**< LastSetTime (Optional) */ + ZCL_TIME_ATTR_VALID_UNTIL_TIME = 0x0009 /**< ValidUntilTime (Optional) */ }; /* Time status bits */ @@ -77,23 +83,52 @@ enum ZbZclTimeSvrAttrT { /** Time Server callbacks configuration */ struct ZbZclTimeServerCallbacks { uint32_t (*get_time)(struct ZbZclClusterT *clusterPtr, void *arg); + /**< Callback to application, invoked on receipt of Read Attribute request */ void (*set_time)(struct ZbZclClusterT *clusterPtr, uint32_t time_val, void *arg); - /**< The set_time app callback should also set the ZCL_TIME_ATTR_LAST_SET_TIME - * attribute if successful. */ + /**< Callback to application, invoked on receipt of Write Attribute request for the ZCL_TIME_ATTR_TIME attribute. The set_time app + * callback should also set the ZCL_TIME_ATTR_LAST_SET_TIME attribute if successful. */ }; +/** + * Create a new instance of the Time Server cluster + * @param zb Zigbee stack instance + * @param endpoint Endpoint on which to create cluster + * @param callbacks Structure containing any callback function pointers for this cluster + * @param arg Pointer to application data that will later be provided back to the callback functions when invoked + * @return Cluster pointer, or NULL if there is an error + */ struct ZbZclClusterT * ZbZclTimeServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclTimeServerCallbacks *callbacks, void *arg); +/* Wrapper to get/set the current time. This is only applicable if ZbZclTimeServerAlloc() was called with use_stack_uptime=true. */ + +/** + * Call the set_time callback defined as part of the Time Server callbacks configuration + * @param cluster Cluster instance from which to send this command + * @param current_time New current time value to set + * @return Void + */ void ZbZclTimeServerSetTime(struct ZbZclClusterT *cluster, uint32_t current_time); +/** + * Call the get_time callback defined as part of the Time Server callbacks configuration + * @param cluster Cluster instance from which to send this command + * @return Current time + */ uint32_t ZbZclTimeServerCurrentTime(struct ZbZclClusterT *cluster); /*--------------------------------------------------------------- * Time Client *--------------------------------------------------------------- */ + +/** + * Create a new instance of the Time Client cluster + * @param zb Zigbee stack instance + * @param endpoint Endpoint on which to create cluster + * @return Cluster pointer, or NULL if there is an error + */ struct ZbZclClusterT * ZbZclTimeClientAlloc(struct ZigBeeT *zb, uint8_t endpoint); #endif /* __ZCL_TIME_H */ |