#include "zcl/se/zcl.drlc.h"
5.11.1 Demand response and load control cluster description
Table 213. Demand response and load control cluster PICS code description
PICS code Name Supported Notes
DRLC.S Server True
-DRLC.C Client True
-DRLC.S.Afffd ClusterRevision server attribute True
-DRLC.S.Afffe AttributeReportingStatus server attribute False
-DRLC.S.C00.Rsp Report Event Status server command True
-DRLC.S.C01.Rsp Get Scheduled Events server command True
-DRLC.S.C00.Tx Load Control Event server command True
-DRLC.S.C01.Tx Cancel Load Control Event server command True
-DRLC.S.C02.Tx Cancel All Load Control Events server command True
-DRLC.C.A0000 UtilityEnrollmentGroup client attribute True
-DRLC.C.A0001 StartRandomizeMinutes client attribute True
-DRLC.C.A0002 StopRandomizeMinutes client attribute True
-DRLC.C.A0003 DeviceClassValue client attribute True
-DRLC.C.Afffd ClusterRevision client attribute True
-DRLC.C.Afffe AttributeReportingStatus client attribute False
-DRLC.C.C00.Rsp Load Control Event client command True
-DRLC.C.C01.Rsp Cancel Load Control Event client command True
-DRLC.C.C02.Rsp Cancel All Load Control Events client command True
-DRLC.C.C00.Tx Report Event Status client command True
-DRLC.C.C01.Tx Get Scheduled Events client command True
-5.11.2 Demand response and load control cluster functions
5.11.2.1 ZbZclDrlcClientAlloc
struct ZbZclClusterT * ZbZclDrlcClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *time_server, struct ZbZclDrlcClientCallbacksT *callbacks, void *cb_arg);
Create a new instance of the DRLC Client cluster
Table 214. ZbZclDrlcClientAlloc parameters
Parameter Description
zb Zigbee® stack instance stack instance endpoint Endpoint on which to create cluster
time_server Time server cluster instance used to retrieve event timing information callbacks Structure containing any callback function pointers for this cluster
cb_arg Pointer to application data that is provided back to the callback function when invoked
Return: Cluster pointer, or NULL if there is an error.
5.11.2.2 ZbZclDrlcClientCommandGetEventsReq
enum ZclStatusCodeT ZbZclDrlcClientCommandGetEventsReq(struct ZbZclClusterT*cluster, const struct ZbApsAddrT *dst, struct ZbZclDrlcGetEventsReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);
Send a Get Scheduled Events
Table 215. ZbZclDrlcClientCommandGetEventsReq parameters
Parameter Description
cluster Cluster instance from which to send this command dst Requested destination address
cmd_req Get Scheduled Events command request structure
callback Callback function that is invoked when the response is received
arg Pointer to application data that is provided back to the callback function when invoked
Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.
5.11.2.3 ZbZclDrlcClientCommandReportStatusReq
enum ZclStatusCodeT ZbZclDrlcClientCommandReportStatusReq(struct ZbZclClusterT*cluster, const struct ZbApsAddrT *dst, struct ZbZclDrlcStatusT *statusPtr, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);
Send a Report Event Status Command
Table 216. ZbZclDrlcClientCommandReportStatusReq Parameters
Parameter Description
cluster Cluster instance from which to send this command dst Requested destination address
statusPtr Report Event Status command request structure
callback Callback function that is invoked when the response is received
arg Pointer to application data that is provided back to the callback function when invoked
Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.
5.11.2.4 ZbZclDrlcClientGetEventList
unsigned int ZbZclDrlcClientGetEventList(struct ZbZclClusterT *cluster, struct ZbZclDrlcEventT *eventList, unsigned int maxEntries);
Send a Get Event List command
Table 217. ZbZclDrlcClientGetEventList parameters
Parameter Description
cluster Cluster instance from which to send this command eventList Holds a pointer to the event list if successful maxEntries Max event list entries
Return: Event list size if successful, or 0 on error
5.11.2.5 ZbZclDrlcServerAlloc
struct ZbZclClusterT * ZbZclDrlcServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclDrlcServerCallbacksT *callbacks, void *arg);
Create a new instance of the DRLC Server cluster
Table 218. ZbZclDrlcServerAlloc parameters
Parameter Description
zb Zigbee® stack instance
endpoint Endpoint on which to create cluster
callbacks Structure containing any callback function pointers for this cluster
arg Pointer to application data that is provided back to the callback function when invoked
Return: Cluster pointer, or NULL if there is an error.
5.11.2.6 ZbZclDrlcServerCommandCancelAllReq
enum ZclStatusCodeT ZbZclDrlcServerCommandCancelAllReq(struct ZbZclClusterT*cluster, uint8_t ctrl, const struct ZbApsAddrT *dst, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void
*arg), void *arg);
Send a Cancel All Load Control Event command
Table 219. ZbZclDrlcServerCommandCancelAllReq parameters
Parameter Description
cluster Cluster instance from which to send this command
ctrl Cancel control bitmap, used to determine cancellation method, for examole ZCL_DRLC_CANCEL_CONTROL_GRACEFUL
dst Requested destination address
callback Callback function that is invoked when the response is received
arg Pointer to application data that is provided back to the callback function when invoked
Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.
5.11.2.7 ZbZclDrlcServerCommandCancelReq
enum ZclStatusCodeT ZbZclDrlcServerCommandCancelReq(struct ZbZclClusterT *cluster, struct ZbZclDrlcCancelT *cancelInfoPtr, const struct ZbApsAddrT *dst, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);
Send a Cancel Load Control Event command
Table 220. ZbZclDrlcServerCommandCancelReq parameters
Parameter Description
cluster Cluster instance from which to send this command eventPtr Cancel Load Control Event command request structure dst Requested destination address
callback Callback function that is invoked when the response is received
Parameter Description
arg Pointer to application data that is provided back to the callback function when invoked
Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.
5.11.2.8 ZbZclDrlcServerCommandEventReq
enum ZclStatusCodeT ZbZclDrlcServerCommandEventReq(struct ZbZclClusterT *cluster, struct ZbZclDrlcEventT *eventPtr, const struct ZbApsAddrT *dst, void (*callback)(struct
ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);
Send a Load Control Event command
Table 221. ZbZclDrlcServerCommandEventReq parameters
Parameter Description
cluster Cluster instance from which to send this command eventPtr Load Control Event command request structure dst Requested destination address
callback Callback function that is invoked when the response is received
arg Pointer to application data that is provided back to the callback function when invoked
Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.
5.11.3 Demand response and load control cluster enumerations
5.11.3.1 ZbZclDrlcCliAttrT DRLC client attribute IDs
Table 222. ZbZclDrlcCliAttrT attributes description
Attribute Description
ZCL_DRLC_CLI_ATTR_UTILITY_ENROL_GRP UtilityEnrollmentGroup
ZCL_DRLC_CLI_ATTR_START_RAND_MINS StartRandomizationMinutes
ZCL_DRLC_CLI_ATTR_DURATION_RAND_MINS DurationRandomizationMinutes
ZCL_DRLC_CLI_ATTR_DEVICE_CLASS DeviceClassValue
5.11.4 Demand response and load control cluster structures
5.11.4.1 ZbZclDrlcCancelT
Cancel Load Control Event command structure
Table 223. ZbZclDrlcCancelT parameters
Parameter Description
uint32_t issuer_event_id Issuer event ID uint16_t device_class Device class
uint8_t util_enrol_group Utility Enrollment Group
uint8_t cancel_control Cancel Control - for example ZCL_DRLC_CANCEL_CONTROL_GRACEFUL
5.11.4.2 ZbZclDrlcClientCallbacksT DRLC Client callbacks configuration
Table 224. ZbZclDrlcClientCallbacksT parameters
Parameter Description
start
(callback function pointer)
bool (*start)(void *arg, struct ZbZclDrlcEventT *event) Callback to application, invoked on the start of an event
stop
(callback function pointer)
void (*stop)(void *arg, struct ZbZclDrlcEventT *event) Callback to application, invoked on the end of an event
5.11.4.3 ZbZclDrlcEventT
Load Control Event command structure
Table 225. ZbZclDrlcEventT parameters
Parameter Description
uint32_t issuer_id Issuer event ID
uint16_t device_class Device class
uint8_t util_enrol_group Utility Enrollment Group uint32_t start_time Start time - UTC time, or 0 = now
uint16_t duration Duration in minutes
enum ZbZclDrlcCriticalityLevelTcriticality Criticality level
uint8_t cool_offset Cooling temperature offset (optional) uint8_t heat_offset Heating temperature offset (optional) int16_t cool_setpoint Cooling temperature set point (optional) int16_t heat_setpoint Heating temperature set point (optional) int8_t avg_load_adj Average load adjustment percentage (optional)
uint8_t dutycycle Duty cycle (optional)
uint8_t event_control Event Control - for example
ZCL_DRLC_EVENT_CTRL_RAND_START
5.11.4.4 ZbZclDrlcGetEventsReqT
Get Scheduled Events command structure
Table 226. ZbZclDrlcGetEventsReqT Parameters
Parameter Description
uint32_t start_time Start Time
uint8_t num_events Number of Events
uint32_t issuer_id Issuer Event ID (optional)
5.11.4.5 ZbZclDrlcServerCallbacksT DRLC Server callbacks configuration
Table 227. ZbZclDrlcServerCallbacksT parameters
Parameter Description
report_status (callback function pointer)
Void (*report_status)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT*srcInfo,struct ZbZclDrlcStatusT*status, void *arg) Callback to application, invoked on receipt of Report Event Status command
get_events
(callback function pointer)
Enum ZclStatusCodeT (*get_events)(struct ZbZclClusterT*cluster, struct ZbZclAddrInfoT *srcInfo,struct ZbZclDrlcGetEventsReqT *req, void *arg) Callback to application, invoked on receipt of Get Scheduled Events command. The
get_events callback handler in the application must return ZCL_STATUS_SUCCESS, or ZCL_STATUS_NOT_FOUND if no events are found. Events are re-issued by calling ZbZclDrlcServerCommandEventReq()
5.11.4.6 ZbZclDrlcStatusT
Report Event Status command structure
Table 228. ZbZclDrlcStatusT parameters
Parameter Description
uint32_t issuer_id Issuer Event ID
enum ZbZclDrlcEventStatusT status Event Status
uint32_t status_time Event Status Time
enum
ZbZclDrlcCriticalityLevelTcrit_level_applied Criticality Level Applied
uint16_t cool_setpoint_applied Cooling temperature set point applied (optional) - Set to ZCL_DRLC_COOL_SETPOINT_IGNORED if not used
uint16_t heat_setpoint_applied
Heating Temperature Set Point Applied (optional) – Set to ZCL_DRLC_HEAT_SETPOINT_IGNORED if not used
int8_t avg_load_adj_applied
Average Load Adjustment Percentage Applied (optional) - Set to
ZCL_DRLC_AVG_LOAD_ADJ_IGNORED if not used uint8_t dutycycle_applied Duty Cycle Applied (optional) - Set to
ZCL_DRLC_DUTYCYCLE_IGNORED if not used
uint8_t event_control Event Control
enum ZbZclDrlcSignatureT sig_type Signature Type
uint8_t sig_data Signature (optional)