Zigbee Cluster Library Overview 4

1. Device Management

#include "zcl/se/zcl.device_mgmt.h"

Functions

ZbZclDeviceMgmtClientAlloc

struct ZbZclClusterT * ZbZclDeviceMgmtClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclDeviceMgmtClientCallbacksT *callbacks, void *arg);

Create a new instance of the Device Management Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclDeviceMgmtClientGetChangeSupplier

enum ZclStatusCodeT ZbZclDeviceMgmtClientGetChangeSupplier(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Change of Supplier command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtClientGetChangeTenancy

enum ZclStatusCodeT ZbZclDeviceMgmtClientGetChangeTenancy(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Change of Tenancy command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtClientGetCin

enum ZclStatusCodeT ZbZclDeviceMgmtClientGetCin(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get CIN command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtClientGetSiteId

enum ZclStatusCodeT ZbZclDeviceMgmtClientGetSiteId(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Site ID command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtClientReportEventConfig

enum ZclStatusCodeT ZbZclDeviceMgmtClientReportEventConfig(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtReportEvtConfigT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Report Event Configuration command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtClientReqNewPassword

enum ZclStatusCodeT ZbZclDeviceMgmtClientReqNewPassword(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtReqNewPassT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Request New Password command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtMirrorAlloc

struct ZbZclClusterT * ZbZclDeviceMgmtMirrorAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *device_mgmt_server,
struct ZbZclClusterT *meter_mirror);

Allocates a Device Management Client Mirror cluster. The caller (application) must attach any attributes to the cluster you want to mirror.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclDeviceMgmtParseReportEvtConfig

enum ZclStatusCodeT ZbZclDeviceMgmtParseReportEvtConfig(struct ZbZclClusterT *cluster, struct ZbApsdeDataIndT *dataIndPtr,
struct ZbZclDeviceMgmtReportEvtConfigT *info);

Parse a Report Event Configuration command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtParseReqNewPassRsp

bool ZbZclDeviceMgmtParseReqNewPassRsp(const uint8_t *buf, unsigned int len, struct ZbZclDeviceMgmtReqNewPassRspT *rsp);

Parse a Request New Password Response command

Parameters

Return

  • True on success, false otherwise

ZbZclDeviceMgmtParseUpdateCin

bool ZbZclDeviceMgmtParseUpdateCin(const uint8_t *buf, unsigned int len, struct ZbZclDeviceMgmtUpdateCinT *rsp);

Parse an Update CIN command

Parameters

Return

  • True on success, false otherwise

ZbZclDeviceMgmtParseUpdateSiteId

bool ZbZclDeviceMgmtParseUpdateSiteId(const uint8_t *buf, unsigned int len, struct ZbZclDeviceMgmtUpdateSiteIdT *rsp);

Parse an Update Site ID command

Parameters

Return

  • True on success, false otherwise

ZbZclDeviceMgmtServerAlloc

struct ZbZclClusterT * ZbZclDeviceMgmtServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclDeviceMgmtServerCallbacksT *callbacks, void *arg);

Create a new instance of the Device Management Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclDeviceMgmtServerGetEventConfigReq

enum ZclStatusCodeT ZbZclDeviceMgmtServerGetEventConfigReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtGetEventConfigT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Event Configuration command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerPublishChangeSupplierRsp

enum ZclStatusCodeT ZbZclDeviceMgmtServerPublishChangeSupplierRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtPublishChangeSupplierT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Change of Supplier as a response to the Get Change of Supplier command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerPublishChangeSupplierUnsolic

enum ZclStatusCodeT ZbZclDeviceMgmtServerPublishChangeSupplierUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtPublishChangeSupplierT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Publish Change of Supplier as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerPublishChangeTenancyRsp

enum ZclStatusCodeT ZbZclDeviceMgmtServerPublishChangeTenancyRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtPublishChangeTenancyT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Change of Tenancy as a response to the Get Change of Tenancy command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerPublishChangeTenancyUnsolic

enum ZclStatusCodeT ZbZclDeviceMgmtServerPublishChangeTenancyUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtPublishChangeTenancyT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Publish Change of Tenancy as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerReqNewPassRsp

enum ZclStatusCodeT ZbZclDeviceMgmtServerReqNewPassRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtReqNewPassRspT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Request New Password Response as a response to the Request New Password command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerReqNewPassRspUnsolic

enum ZclStatusCodeT ZbZclDeviceMgmtServerReqNewPassRspUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtReqNewPassRspT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Request New Password Response as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerSetEventConfigReq

enum ZclStatusCodeT ZbZclDeviceMgmtServerSetEventConfigReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtSetEventConfigT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Event Configuration command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerUpdateCinRsp

enum ZclStatusCodeT ZbZclDeviceMgmtServerUpdateCinRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtUpdateCinT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send an Update CIN as a response to the Get CIN command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerUpdateCinUnsolic

enum ZclStatusCodeT ZbZclDeviceMgmtServerUpdateCinUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtUpdateCinT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Update CIN as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerUpdateSiteIdRsp

enum ZclStatusCodeT ZbZclDeviceMgmtServerUpdateSiteIdRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclDeviceMgmtUpdateSiteIdT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send an Update SiteID as a response to the Get SiteID command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDeviceMgmtServerUpdateSiteIdUnsolic

enum ZclStatusCodeT ZbZclDeviceMgmtServerUpdateSiteIdUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclDeviceMgmtUpdateSiteIdT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an Update SiteID as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclDeviceMgmtCliAttrT

Device Management Client Attribute IDs

ZbZclDeviceMgmtSvrAttrT

Device Management Server Attribute IDs

Structures

ZbZclDeviceMgmtClientCallbacksT

Device Management Client callbacks configuration

Parameters

ZbZclDeviceMgmtEventConfigPayloadT

Event Configuration Payload structure

Parameters

ZbZclDeviceMgmtGetEventConfigT

Get Event Configuration command structure

Parameters

ZbZclDeviceMgmtPublishChangeSupplierT

Publish Change of Supplier command structure

Parameters

ZbZclDeviceMgmtPublishChangeTenancyT

Publish Change of Tenancy command structure

Parameters

ZbZclDeviceMgmtReportEvtConfigT

Report Event Configuration command structure

Parameters

ZbZclDeviceMgmtReqNewPassRspT

Request New Password Response command structure

Parameters

ZbZclDeviceMgmtReqNewPassT

Request New Password command structure

Parameters

ZbZclDeviceMgmtServerCallbacksT

Device Management Server callbacks configuration

Parameters

ZbZclDeviceMgmtSetEventConfigT

Set Event command structure

Parameters

ZbZclDeviceMgmtUpdateCinT

Update CIN Configuration command structure

Parameters

ZbZclDeviceMgmtUpdateSiteIdT

Update SiteID command structure

Parameters

2. Demand Response and Load Control

#include "zcl/se/zcl.drlc.h"

Functions

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

Parameters

Return

  • Cluster pointer, or NULL if there is an error

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

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

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

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDrlcClientGetEventList

unsigned int ZbZclDrlcClientGetEventList(struct ZbZclClusterT *cluster, struct ZbZclDrlcEventT *eventList, unsigned int maxEntries);

Send a Get Event List command

Parameters

Return

  • Event list size if successful, or 0 on error

ZbZclDrlcClientOptOutAdd

enum ZclStatusCodeT ZbZclDrlcClientOptOutAdd(struct ZbZclClusterT *cluster, uint32_t issuer_id);

Append an Issuer Event ID to "opt-out" of

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDrlcClientOptOutClear

enum ZclStatusCodeT ZbZclDrlcClientOptOutClear(struct ZbZclClusterT *cluster);

Clear all Issuer Event IDs in list to "opt-out" of

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDrlcClientOptOutDel

enum ZclStatusCodeT ZbZclDrlcClientOptOutDel(struct ZbZclClusterT *cluster, uint32_t issuer_id);

Invalidate an Issuer Event ID to "opt-out" of

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclDrlcServerAlloc

struct ZbZclClusterT * ZbZclDrlcServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclDrlcServerCallbacksT *callbacks, void *arg);

Create a new instance of the DRLC Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

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

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

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

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

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

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclDrlcCliAttrT

DRLC Client Attribute IDs

Structures

ZbZclDrlcCancelT

Cancel Load Control Event command structure

Parameters

ZbZclDrlcClientCallbacksT

DRLC Client callbacks configuration

Parameters

ZbZclDrlcEventT

Load Control Event command structure

Parameters

ZbZclDrlcGetEventsReqT

Get Scheduled Events command structure

Parameters

ZbZclDrlcServerCallbacksT

DRLC Server callbacks configuration

Parameters

ZbZclDrlcStatusT

Report Event Status command structure

Parameters

3. Energy Management

#include "zcl/se/zcl.energy_mgmt.h"

Functions

ZbZclEnergyMgmtClientAlloc

struct ZbZclClusterT * ZbZclEnergyMgmtClientAlloc(struct ZigBeeT *zb, uint8_t endpoint);

Create a new instance of the Energy Management Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclEnergyMgmtClientManageEventReq

enum ZclStatusCodeT ZbZclEnergyMgmtClientManageEventReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclEnergyMgmtManageEventT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Manage Event command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclEnergyMgmtServerAlloc

struct ZbZclClusterT * ZbZclEnergyMgmtServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclEnergyMgmtServerCallbacksT *callbacks, void *arg);

Create a new instance of the Energy Management Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclEnergyMgmtServerReportEvtStatus

enum ZclStatusCodeT ZbZclEnergyMgmtServerReportEvtStatus(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst, struct ZbZclDrlcStatusT *info,
void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Create a new instance of the Energy Management Server cluster

Parameters

Return

  • Undocumented

Enumerations

ZbZclEnergyMgmtSvrAttrT

Energy Management Server Attribute IDs

Structures

ZbZclEnergyMgmtManageEventT

Manage Event (ZCL_ENERGY_MGMT_CLI_CMD_MANAGE_EVENT) command structure

Parameters

ZbZclEnergyMgmtServerCallbacksT

Energy Management Server callbacks configuration

Parameters

4. Events

#include "zcl/se/zcl.events.h"

Functions

ZbZclEventsClientAlloc

struct ZbZclClusterT * ZbZclEventsClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclEventsClientCallbacksT *callbacks, void *arg);

Create a new instance of the Events Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclEventsClientCommandClearEventLogReq

enum ZclStatusCodeT ZbZclEventsClientCommandClearEventLogReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclEventsClientClearEventLogT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Clear Event Log command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclEventsClientCommandGetEventLogReq

enum ZclStatusCodeT ZbZclEventsClientCommandGetEventLogReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclEventsClientGetEventLogT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Event Log command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclEventsMirrorAlloc

struct ZbZclClusterT * ZbZclEventsMirrorAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *events_client,
struct ZbZclClusterT *meter_mirror);

Allocates a Events Server Mirror cluster. The caller (application) must attach any attributes to the cluster you want to mirror.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclEventsServerAlloc

struct ZbZclClusterT * ZbZclEventsServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclEventsServerCallbacksT *callbacks, void *arg);

Create a new instance of the Events Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclEventsServerClearEventLogRsp

enum ZclStatusCodeT ZbZclEventsServerClearEventLogRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclEventsServerClearEventLogResponseT *rsp);

Send a Clear Event Log Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclEventsServerPublishEventUnsolic

enum ZclStatusCodeT ZbZclEventsServerPublishEventUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclEventsServerPublishEventT *event, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Publish Event command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Structures

ZbZclEventsClientCallbacksT

Events Client callbacks configuration

Parameters

ZbZclEventsClientClearEventLogT

Clear Event Log command structure

Parameters

ZbZclEventsClientGetEventLogT

Get Event Log command structure

Parameters

ZbZclEventsServerCallbacksT

Events Server callbacks configuration

Parameters

ZbZclEventsServerClearEventLogResponseT

Clear Event Log Response command structure

Parameters

ZbZclEventsServerEventLogPayloadT

Publish Event Log Payload structure

Parameters

ZbZclEventsServerPublishEventLogT

Publish Event Log command structure

Parameters

ZbZclEventsServerPublishEventT

Publish Event command structure

Parameters

5. Messaging

#include "zcl/se/zcl.message.h"

Functions

ZbZclMessageClientParseDisplayMsg

enum ZclStatusCodeT ZbZclMessageClientParseDisplayMsg(struct ZbZclMsgMessageT *msg, uint8_t *payload, unsigned int len);

Parses a ZCL_MESSAGE_SVR_CMD_DISPLAY_MESSAGE paylaod into a 'struct ZbZclMsgMessageT'.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgClientAlloc

struct ZbZclClusterT * ZbZclMsgClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclMsgClientCallbacksT *callbacks, void *arg);

Create a new instance of the Messaging Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMsgClientConfEnhReq

enum ZclStatusCodeT ZbZclMsgClientConfEnhReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst, struct ZbZclMsgConfirmEnhT *msg_conf_enh,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an Enhanced Message Confirmation command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgClientConfReq

enum ZclStatusCodeT ZbZclMsgClientConfReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst, struct ZbZclMsgConfirmT *msg_conf,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Message Confirmation command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgClientGetLastReq

enum ZclStatusCodeT ZbZclMsgClientGetLastReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Last Message command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgClientGetMsgCancelReq

enum ZclStatusCodeT ZbZclMsgClientGetMsgCancelReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst, uint32_t earliestTime,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Message Cancellation command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgMirrorAlloc

struct ZbZclClusterT * ZbZclMsgMirrorAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *msg_server,
struct ZbZclClusterT *meter_mirror, struct ZbZclClusterT *meter_client);

Allocates a Messaging Client Mirror cluster.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMsgServerAlloc

struct ZbZclClusterT * ZbZclMsgServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclMsgServerCallbacksT *callbacks, void *arg);

Create a new instance of the Messaging Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMsgServerCancelAllRsp

enum ZclStatusCodeT ZbZclMsgServerCancelAllRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclMsgMessageCancelAllT *cancel_all);

Send a Cancel All Messages command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgServerCancelAllUnsolic

enum ZclStatusCodeT ZbZclMsgServerCancelAllUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMsgMessageCancelAllT *cancel_all, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an Unsolicited Cancel All Messages command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgServerCancelMessageReq

enum ZclStatusCodeT ZbZclMsgServerCancelMessageReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst, struct ZbZclMsgMessageCancelT *cancel,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Cancel Message command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgServerDisplayMessageRsp

enum ZclStatusCodeT ZbZclMsgServerDisplayMessageRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo, struct ZbZclMsgMessageT *msg);

Send a Display or Display Protected Message as response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMsgServerDisplayMessageUnsolic

enum ZclStatusCodeT ZbZclMsgServerDisplayMessageUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMsgMessageT *msg, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Display or Display Protected Message command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Structures

ZbZclMsgClientCallbacksT

Messaging Client callbacks configuration

Parameters

ZbZclMsgConfirmEnhT

Enhanced Message Confirmation command structure

Parameters

ZbZclMsgConfirmT

Message Confirmation command structure

Parameters

ZbZclMsgGetMsgCancellationT

Get Messsage Cancellation command structure

Parameters

ZbZclMsgMessageCancelAllT

Cancel All Messages command structure

Parameters

ZbZclMsgMessageCancelT

Cancel Message command structure

Parameters

ZbZclMsgMessageConfT

Message Confirmation callback structure

Parameters

ZbZclMsgMessageT

Display Message/Display Protected Message command structure

Parameters

ZbZclMsgServerCallbacksT

Messaging Server callbacks configuration

Parameters

6. Metering

#include "zcl/se/zcl.meter.h"

Functions

ZbZclMeterClientAlloc

struct ZbZclClusterT * ZbZclMeterClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclMeterClientCallbacksT *callbacks, void *arg);

Create a new instance of the Metering Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMeterClientAttachMirror

bool ZbZclMeterClientAttachMirror(struct ZbZclClusterT *cluster, struct ZbZclClusterT mirror_server, uint64_t rmt_addr, uint8_t rmt_endpoint);

Attach the Meter Mirror Server to the Meter Client. Configures the Client to manage the Mirror Server, and handle reports from the remote Meter and update the Mirror Server attributes.

Parameters

Return

  • True if the Mirror Server could be attached, false otherwise.

ZbZclMeterClientClearNotifFlag

bool ZbZclMeterClientClearNotifFlag(struct ZbZclClusterT *cluster, uint16_t attr_id, uint32_t notif_flag);

Clear the Metering Client notification flag(s).

Parameters

Return

  • True if notification flag is cleared successfully, false otherwise.

ZbZclMeterClientCommandChangeSupplyReq

enum ZclStatusCodeT ZbZclMeterClientCommandChangeSupplyReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientChangeSupplyReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Change Supply Command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandFastPollReq

enum ZclStatusCodeT ZbZclMeterClientCommandFastPollReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientFastPollModeReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Request Fast Poll Mode command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandGetProfileReq

enum ZclStatusCodeT ZbZclMeterClientCommandGetProfileReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientGetProfileReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Profile command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandGetSampledDataReq

enum ZclStatusCodeT ZbZclMeterClientCommandGetSampledDataReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientGetSampledDataReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Sampled Data command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandGetSnapshotReq

enum ZclStatusCodeT ZbZclMeterClientCommandGetSnapshotReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientGetSnapshotReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Snapshot command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandLocalChangeSupplyReq

enum ZclStatusCodeT ZbZclMeterClientCommandLocalChangeSupplyReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientLocalChangeSupplyReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Local Change Supply command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandResetLoadLimitCounterReq

enum ZclStatusCodeT ZbZclMeterClientCommandResetLoadLimitCounterReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientResetLoadLimitCounterReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send Reset Load Limit Counter command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandScheduleSnapshotReq

enum ZclStatusCodeT ZbZclMeterClientCommandScheduleSnapshotReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientScheduleSnapshotReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Schedule Snapshot Request command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandSetSupplyStatusReq

enum ZclStatusCodeT ZbZclMeterClientCommandSetSupplyStatusReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientSetSupplyStatusReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Supply Status command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandSetUnctrlFlowThreshReq

enum ZclStatusCodeT ZbZclMeterClientCommandSetUnctrlFlowThreshReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientSetUnctrlFlowThreshReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Uncontrolled Flow Threshold command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandStartSamplingReq

enum ZclStatusCodeT ZbZclMeterClientCommandStartSamplingReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientStartSamplingReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Start Sampling command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientCommandTakeSnapshotReq

enum ZclStatusCodeT ZbZclMeterClientCommandTakeSnapshotReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterClientTakeSnapshotReqT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Take Snapshot command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterClientSetNotifFlag

bool ZbZclMeterClientSetNotifFlag(struct ZbZclClusterT *cluster, uint16_t attr_id, uint32_t notif_flag);

Set the Metering Client notification flag(s).

Parameters

Return

  • True if notification flag is set successfully, false otherwise.

ZbZclMeterFormSampledData

int ZbZclMeterFormSampledData(uint8_t *sample_data, unsigned int max_len, uint32_t *samples, uint16_t num_samples);

Convert an array of 24-bit integers to the Zigbee frame format

Parameters

Return

  • Returns the number of octets written to sample_data or -1 on error

ZbZclMeterGetProfileIntervalPeriod

int ZbZclMeterGetProfileIntervalPeriod(uint8_t profile_interval_id);

Convert the profile interval period enumerated value to a time in seconds

Parameters

Return

  • Converted time in seconds or -1 on error

ZbZclMeterMirrorAlloc

struct ZbZclClusterT * ZbZclMeterMirrorAlloc(struct ZigBeeT *zb, struct ZbZclClusterT *client, uint8_t endpoint, uint64_t meter_extaddr,
uint8_t meter_endpoint);

Allocate a Meter Server used for Mirroring.

Parameters

Return

  • Undocumented

ZbZclMeterMirrorBomdReadReq

enum ZclStatusCodeT ZbZclMeterMirrorBomdReadReq(struct ZbZclClusterT *meter_mirror, struct ZbZclClusterT *client,
struct ZbZclReadReqT *req, void (*callback)(const struct ZbZclReadRspT *readRsp, void *cb_arg), void *arg);

Sends a One-Way Mirror ZCL Read Request to the BOMD. The request is queued until the BOMD wakes up. The ZCL_METER_FUNC_NOTIF_FLAG_STAY_AWAKE_HAN notification flag is set so the BOMD knows to keep polling for data after waking up. The Metering Mirror Cluster must already be allocated.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterMirrorBomdWriteReq

enum ZclStatusCodeT ZbZclMeterMirrorBomdWriteReq(struct ZbZclClusterT *meter_mirror, struct ZbZclClusterT *client, struct ZbZclWriteReqT *req,
void (*callback)(const struct ZbZclWriteRspT *writeRsp, void *cb_arg), void *arg);

Sends a One-Way Mirror ZCL Write Request to the BOMD. The request is queued until the BOMD wakes up. The ZCL_METER_FUNC_NOTIF_FLAG_STAY_AWAKE_HAN notification flag is set so the BOMD knows to keep polling for data after waking up. The Metering Mirror Cluster must already be allocated.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerAlloc

struct ZbZclClusterT * ZbZclMeterServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclMeterServerCallbacksT *callbacks, void *arg);

Create a new instance of the Metering Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMeterServerPublishSnapshotRsp

enum ZclStatusCodeT ZbZclMeterServerPublishSnapshotRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclMeterServerPublishSnapshotT *rsp);

Send a Publish Snapshot Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerPublishSnapshotUnsolic

enum ZclStatusCodeT ZbZclMeterServerPublishSnapshotUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclMeterServerPublishSnapshotT *req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an Unsolicited Publish Snapshot command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendConfigMirror

enum ZclStatusCodeT ZbZclMeterServerSendConfigMirror(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst, struct ZbZclMeterServerConfigMirrorT *req,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a ConfigureMirror Command (ZCL_METER_SVR_CMD_CONFIGURE_MIRROR)

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendConfigNotifFlags

enum ZclStatusCodeT ZbZclMeterServerSendConfigNotifFlags(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
struct ZbZclMeterServerConfigNotifFlagsT *req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Configure Notification Flags Command (ZCL_METER_SVR_CMD_CONFIGURE_NOTIFICATION_FLAG) "Where ‘Two Way Mirroring’ is being implemented, and a non-default Notification Scheme is to be used, the ConfigureNotificationFlags command allows a BOMD to set the commands relating to the bit value for each NotificationFlags#N attribute that the scheme is proposing to use. This command should be used in conjunction with the associated ConfigureNotificationScheme command."

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendConfigNotifScheme

enum ZclStatusCodeT ZbZclMeterServerSendConfigNotifScheme(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
struct ZbZclMeterServerConfigNotifSchemeT *req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Configure Notification Scheme Command (ZCL_METER_SVR_CMD_CONFIGURE_NOTIFICATION_SCHEME)

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendFastPollModeRsp

enum ZclStatusCodeT ZbZclMeterServerSendFastPollModeRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclMeterServerFastPollModeRspT *rsp);

Send a Request Fast Poll Mode Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendGetNotifMsg

enum ZclStatusCodeT ZbZclMeterServerSendGetNotifMsg(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
struct ZbZclMeterServerGetNotifMsgT *req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Notified Message Command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendGetProfileRsp

enum ZclStatusCodeT ZbZclMeterServerSendGetProfileRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclMeterServerGetProfileRspT *rsp);

Send a Get Profile Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendGetSampledDataRsp

enum ZclStatusCodeT ZbZclMeterServerSendGetSampledDataRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclMeterServerGetSampledDataRspT *rsp);

Send a Get Sampled Data Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendRemoveMirror

enum ZclStatusCodeT ZbZclMeterServerSendRemoveMirror(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Remove Mirror Command (ZCL_METER_SVR_CMD_REMOVE_MIRROR)

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendRequestMirror

enum ZclStatusCodeT ZbZclMeterServerSendRequestMirror(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Request Mirror Command (ZCL_METER_SVR_CMD_REQUEST_MIRROR)

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error. The callback will only be called if this function returns SUCCESS.

ZbZclMeterServerSendScheduleSnapshotRsp

enum ZclStatusCodeT ZbZclMeterServerSendScheduleSnapshotRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclMeterClientScheduleSnapshotRspT *rsp);

Send a Schedule Snapshot Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendStartSamplingRsp

enum ZclStatusCodeT ZbZclMeterServerSendStartSamplingRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclMeterClientStartSamplingRspT *rsp);

Send a Start Sampling Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendSupplyStatusRsp

enum ZclStatusCodeT ZbZclMeterServerSendSupplyStatusRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclMeterServerSupplyStatusRspT *rsp);

Send a Supply Status Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclMeterServerSendTakeSnapshotRsp

enum ZclStatusCodeT ZbZclMeterServerSendTakeSnapshotRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclMeterClientTakeSnapshotRspT *rsp);

Send a Take Snapshot Response command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Structures

ZbZclMeterClientMirrorReportAttrRspT

MirrorReportAttributeResponse Command

Parameters

7. Prepayment

#include "zcl/se/zcl.prepay.h"

Functions

ZbZclPrepayClientAlloc

struct ZbZclClusterT * ZbZclPrepayClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPrepayClientCallbacksT *callbacks, void *arg);

Create a new instance of the Prepayment Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPrepayClientChangeDebtReq

enum ZclStatusCodeT ZbZclPrepayClientChangeDebtReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayChangeDebtReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Change Debt command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientChangePaymentModeReq

enum ZclStatusCodeT ZbZclPrepayClientChangePaymentModeReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayChangePaymentModeReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Change Payment Mode command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientConsumerTopUpReq

enum ZclStatusCodeT ZbZclPrepayClientConsumerTopUpReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayConsumerTopUpReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Consumer Top Up command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientCreateMirror

struct ZbZclClusterT * ZbZclPrepayClientCreateMirror(struct ZbZclClusterT *cluster, uint8_t endpoint, struct ZbZclClusterT *meter_mirror_client,
struct ZbZclClusterT *meter_mirror_server, uint64_t rmt_addr, uint8_t rmt_endpoint);

Allocates a PrePayment Server Mirror cluster. The caller (application) must attach any attributes to the cluster you want to mirror. By default, stack attaches the mandatory prepayment server attributes.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPrepayClientCreditAdjustReq

enum ZclStatusCodeT ZbZclPrepayClientCreditAdjustReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayCreditAdjustReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Credit Adjustment command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientEmergCreditSetupReq

enum ZclStatusCodeT ZbZclPrepayClientEmergCreditSetupReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayEmergCreditSetupReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Emergency Credit Setup command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientGetDebtRepayLogReq

enum ZclStatusCodeT ZbZclPrepayClientGetDebtRepayLogReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayGetDebtRepayLogReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Debt Repayment Log command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientGetPrepaySnapshotReq

enum ZclStatusCodeT ZbZclPrepayClientGetPrepaySnapshotReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayGetPrepaySnapshotReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Prepay Snapshot command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientGetTopUpLogReq

enum ZclStatusCodeT ZbZclPrepayClientGetTopUpLogReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayGetTopUpLogReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get TopUp Log command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientSelectAvailEmergCreditReq

enum ZclStatusCodeT ZbZclPrepayClientSelectAvailEmergCreditReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepaySelectAvailEmergCreditReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Select Available Emergency Credit command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientSetLowCreditWarnLevelReq

enum ZclStatusCodeT ZbZclPrepayClientSetLowCreditWarnLevelReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepaySetLowCreditWarnLevelReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Low Credit Warning Level command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientSetMaxCreditLimitReq

enum ZclStatusCodeT ZbZclPrepayClientSetMaxCreditLimitReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepaySetMaxCreditLimitReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Max Credit Limit command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayClientSetOverallDebtCapReq

enum ZclStatusCodeT ZbZclPrepayClientSetOverallDebtCapReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepaySetOverallDebtCapReqT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Overall Debt Cap command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerAlloc

struct ZbZclClusterT * ZbZclPrepayServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *time_server,
struct ZbZclPrepayServerCallbacksT *callbacks, void *arg);

Create a new instance of the Prepayment Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPrepayServerAttrCreditRemainingWriteCb

enum ZclStatusCodeT ZbZclPrepayServerAttrCreditRemainingWriteCb(struct ZbZclClusterT *cluster, struct ZbZclAttrCbInfoT *info);

Prepayment server default write callback for optional attribute 'Credit Remaining'.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerChangePaymentModeRsp

enum ZclStatusCodeT ZbZclPrepayServerChangePaymentModeRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPrepayChangePaymentModeRspT *info);

Send a Change Payment Mode response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerConsumerTopUpRsp

enum ZclStatusCodeT ZbZclPrepayServerConsumerTopUpRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPrepayConsumerTopUpRspT *info);

Send a Consumer Top Up response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishDebtLogRsp

enum ZclStatusCodeT ZbZclPrepayServerPublishDebtLogRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclPrepayPublishDebtLogT *info);

Send a Publish Debt Log Response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishDebtLogUnsolic

enum ZclStatusCodeT ZbZclPrepayServerPublishDebtLogUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayPublishDebtLogT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Debt Log

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishPrepaySnapshotRsp

enum ZclStatusCodeT ZbZclPrepayServerPublishPrepaySnapshotRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclPrepayPublishPrepaySnapshotT *info);

Send a Publish Prepay Snapshot as a response to the GetPrepaySnapshot command.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishPrepaySnapshotUnsolic

enum ZclStatusCodeT ZbZclPrepayServerPublishPrepaySnapshotUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayPublishPrepaySnapshotT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Publish Prepay Snapshot as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishTopUpLogRsp

enum ZclStatusCodeT ZbZclPrepayServerPublishTopUpLogRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dstInfo,
struct ZbZclPrepayPublishTopUpLogT *info);

Send a Publish Top Up Log as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerPublishTopUpLogUnsolic

enum ZclStatusCodeT ZbZclPrepayServerPublishTopUpLogUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPrepayPublishTopUpLogT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Publish Top Up Log as an unsolicited command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerUpdateAlarmStatusFlag

enum ZclStatusCodeT ZbZclPrepayServerUpdateAlarmStatusFlag(struct ZbZclClusterT *cluster, uint16_t flag, bool set);

Set/Clear the alram status flag in 'Alarm Status' attribute.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPrepayServerUpdateCreditStatusFlag

enum ZclStatusCodeT ZbZclPrepayServerUpdateCreditStatusFlag(struct ZbZclClusterT *cluster, uint8_t flag, bool set);

Set/Clear the credit status flag in 'Credit Status' attribute.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_prepay_get_topup_record

bool zcl_prepay_get_topup_record(struct ZbZclClusterT *cluster, struct ZbZclPrepayTopUpPayloadT *payload, uint8_t attr_idx);

Helper function to retrieve the topup record from the topup attribute set pointed by attribute index.

Parameters

Return

  • true if the top up record is retrieved successfully, false otherwise.

zcl_prepay_topup_code_duplicate_check

bool zcl_prepay_topup_code_duplicate_check(struct ZbZclClusterT *cluster, const uint8_t *topup_code);

Helper function to check if the topup code received is duplicate or not.

Parameters

Return

  • true if the received topup code is duplicate, false otherwise.

zcl_prepay_update_topup_attrs

enum ZbZclPrepayTopUpResultT zcl_prepay_update_topup_attrs(struct ZbZclClusterT *cluster, enum ZbZclPrepayOriginDeviceT origin_device,
uint8_t *topup_code, int32_t topup_value);

Helper function to update the prepayment server topup attributes on receiving the consumer topup command.

Parameters

Return

  • ZCL_PREPAY_TOPUP_RSLT_ACCEPTED if the topup attributes are updated successfully, ZCL_PREPAY_TOPUP_RSLT_RJCTD_MAX_CREDIT if the top amount results in credit remaining value exceeding the maximum credit limit.

Enumerations

ZbZclPreaymentSvrAttrT

Prepayment Server Attribute IDs

ZbZclPrepayCreditTypeT

Credit Type Field enumerations

ZbZclPrepayDebtRecMethodT

Debt Recovery Method enumerations

ZbZclPrepayDebtTypeT

Debt Type Field enumerations

ZbZclPrepayOriginDeviceT

Originating Device Field enumerations

ZbZclPrepaySnapshotPayloadTypeT

Prepayment Snapshot Payload type.

ZbZclPrepayTopUpResultT

Result Type Field enumerations

Structures

ZbZclPrepayChangeDebtReqT

Change Debt command structure

Parameters

ZbZclPrepayChangePaymentModeReqT

Change Payment Mode command structure (ZCL_PREPAY_CLI_CMD_CHANGE_PAYMENT_MODE)

Parameters

ZbZclPrepayChangePaymentModeRspT

Consumer Change Supply Mode Response command structure

Parameters

ZbZclPrepayConsumerTopUpReqT

Consumer Top Up command structure

Parameters

ZbZclPrepayConsumerTopUpRspT

Consumer Top Up Response command structure

Parameters

ZbZclPrepayCreditAdjustReqT

Credit Adjustment command structure (ZCL_PREPAY_CLI_CMD_CREDIT_ADJUST)

Parameters

ZbZclPrepayDebtRecordT

Debt Payload structure

Parameters

ZbZclPrepayEmergCreditSetupReqT

Emergency Credit Setup command structure

Parameters

ZbZclPrepayGetDebtRepayLogReqT

Get Debt Repayment Log command structure

Parameters

ZbZclPrepayGetPrepaySnapshotReqT

Get Prepay Snapshot command structure (ZCL_PREPAY_CLI_CMD_GET_PREPAY_SNAPSHOT)

Parameters

ZbZclPrepayGetTopUpLogReqT

Get TopUp Log command structure

Parameters

ZbZclPrepayPublishDebtLogT

Publish Debt Log command structure

Parameters

ZbZclPrepaySelectAvailEmergCreditReqT

Select Available Emergency Credit command structure

Parameters

ZbZclPrepayServerCallbacksT

Prepayment Server callbacks configuration

Parameters

ZbZclPrepaySetLowCreditWarnLevelReqT

Set Low Credit Warning Level

Parameters

ZbZclPrepaySetMaxCreditLimitReqT

Set Maximum Credit Limit

Parameters

ZbZclPrepaySetOverallDebtCapReqT

Set Overall Debt Cap

Parameters

8. Price

#include "zcl/se/zcl.price.h"

Functions

ZbZclPriceClientAlloc

struct ZbZclClusterT * ZbZclPriceClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPriceClientCallbacksT *callbacks, void *arg);

Create a new instance of the Price Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPriceClientCommandGetBillingPeriodReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetBillingPeriodReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetBillingPeriodT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Billing Period command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetBlockPeriodReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetBlockPeriodReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetBlockPeriodT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Block Period(s) command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetBlockThresholdsReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetBlockThresholdsReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetBlockThresholdsT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Block Thresholds command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetCO2ValueReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetCO2ValueReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetCO2ValueT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get CO2 Value command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetCalorificValueReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetCalorificValueReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetCalorificValueT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Calorific Value command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetConsolidatedBillReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetConsolidatedBillReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetConsolidatedBillT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Consolidated Bill command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetConversionFactorReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetConversionFactorReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetConversionFactorT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Conversion Factor command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetCurrencyConversionReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetCurrencyConversionReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Currency Conversion command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetCurrentPriceReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetCurrentPriceReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Current Price command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetPriceMatrixReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetPriceMatrixReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetPriceMatrixT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Price Matrix command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetScheduledPricesReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetScheduledPricesReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetScheduledPricesT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Scheduled Prices command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandGetTariffInfoReq

enum ZclStatusCodeT ZbZclPriceClientCommandGetTariffInfoReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientGetTariffInfoT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Get Tariff Information command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceClientCommandPriceAckReq

enum ZclStatusCodeT ZbZclPriceClientCommandPriceAckReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceClientPriceAckT *cmd_req, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Price Acknowledgement command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceMirrorAlloc

struct ZbZclClusterT * ZbZclPriceMirrorAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *price_server,
struct ZbZclClusterT *meter_mirror, struct ZbZclClusterT *meter_client);

Allocates a Price Client Mirror cluster.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPriceServerAlloc

struct ZbZclClusterT * ZbZclPriceServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPriceServerCallbacksT *callbacks, void *arg);

Create a new instance of the Price Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPriceServerPublishPriceInit

void ZbZclPriceServerPublishPriceInit(struct ZbZclPriceServerPublishPriceT *rsp);

Initialize Publish Price information

Parameters

Return

  • Void

ZbZclPriceServerSendPublishBillingPeriodRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishBillingPeriodRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishBillingPeriodT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Billing Period command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishBillingPeriodUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishBillingPeriodUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishBillingPeriodT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Billing Period command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishBlockPeriodRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishBlockPeriodRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishBlockPeriodT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Block Period command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishBlockPeriodUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishBlockPeriodUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishBlockPeriodT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Block Period command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishBlockThresholdsRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishBlockThresholdsRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishBlockThresholdsT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Block Thresholds command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishBlockThresholdsUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishBlockThresholdsUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishBlockThresholdsT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Block Thresholds command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishCO2ValueRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishCO2ValueRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishCO2ValueT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish CO2 Value command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishCO2ValueUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishCO2ValueUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishCO2ValueT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish CO2 Value command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishCalorificValueRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishCalorificValueRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishCalorificValueT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Calorific Value command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishCalorificValueUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishCalorificValueUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishCalorificValueT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Calorific Value command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishConsolidatedBillRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishConsolidatedBillRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishConsolidatedBillT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Consolidated Bill command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZCL_STATUS value on error

ZbZclPriceServerSendPublishConsolidatedBillUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishConsolidatedBillUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishConsolidatedBillT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Consolidated Bill command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZCL_STATUS value on error

ZbZclPriceServerSendPublishConversionFactorRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishConversionFactorRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishConversionFactorT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Conversion Factor command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishConversionFactorUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishConversionFactorUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishConversionFactorT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Conversion Factor command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishCurrencyConversionRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishCurrencyConversionRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishCurrencyConversionT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Currency Conversion command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS or other ZCL_STATUS value on error

ZbZclPriceServerSendPublishCurrencyConversionUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishCurrencyConversionUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishCurrencyConversionT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Currency Conversion command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful or other ZCL_STATUS value on error

ZbZclPriceServerSendPublishMatrixUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishMatrixUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishPriceMatrixT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Price Matrix command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishPriceRsp

enum ZclStatusCodeT ZbZclPriceServerSendPublishPriceRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPriceServerPublishPriceT *info, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a Publish Price command as a response

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishPriceUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishPriceUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishPriceT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Price command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPriceServerSendPublishTariffInfoUnsolic

enum ZclStatusCodeT ZbZclPriceServerSendPublishTariffInfoUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPriceServerPublishTariffInfoT *info, void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send an unsolicited Publish Tariff Information command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclPriceSvrAttrT

Price Server Attribute IDs

ZbZclPriceTariffChargingSchemeT

Tariff Charging Scheme Enumeration

ZbZclPriceTariffTypeT

Tariff Type Enumeration

ZbZclPriceTierBlockModeT

Tier Block Mode Enumeration

Structures

ZbZclPriceClientCallbacksT

Price Client callbacks configuration

Parameters

ZbZclPriceClientGetBillingPeriodT

Get Billing Period command structure

Parameters

ZbZclPriceClientGetBlockPeriodT

Get Block Period command structure

Parameters

ZbZclPriceClientGetBlockThresholdsT

Get Block Thresholds command structure

Parameters

ZbZclPriceClientGetCO2ValueT

Get CO2 Value command structure

Parameters

ZbZclPriceClientGetCalorificValueT

Get Calorific Value command structure

Parameters

ZbZclPriceClientGetConsolidatedBillT

Get Consolidated Bill command structure

Parameters

ZbZclPriceClientGetConversionFactorT

Get Conversion Factor command structure

Parameters

ZbZclPriceClientGetCurrentPriceT

Get Current Price command structure

Parameters

ZbZclPriceClientGetPriceMatrixT

Get Price Matrix command structure

Parameters

ZbZclPriceClientGetScheduledPricesT

Get Scheduled Prices command structure

Parameters

ZbZclPriceClientGetTariffInfoT

Get Tariff Information command structure

Parameters

ZbZclPriceClientPriceAckT

Price Acknowledge command structure

Parameters

ZbZclPriceServerBlockThreshEntryT

Block Threshold Entry structure

Parameters

ZbZclPriceServerCallbacksT

Price Server callbacks configuration

Parameters

ZbZclPriceServerPriceMatrixEntryT

Price Matrix Entry structure

Parameters

ZbZclPriceServerPublishBillingPeriodT

Publish Billing Period command structure

Parameters

ZbZclPriceServerPublishBlockPeriodT

Publish Block Period

Parameters

ZbZclPriceServerPublishBlockThresholdsT

Publish Block Thresholds command structure

Parameters

ZbZclPriceServerPublishCO2ValueT

Publish CO2 Value command structure

Parameters

ZbZclPriceServerPublishCalorificValueT

Publish Calorific Value command structure

Parameters

ZbZclPriceServerPublishConsolidatedBillT

Publish Consolidated Bill command structure

Parameters

ZbZclPriceServerPublishConversionFactorT

Publish Conversion Factor command structure

Parameters

ZbZclPriceServerPublishCurrencyConversionT

Publish Currency Conversion command structure

Parameters

ZbZclPriceServerPublishPriceMatrixT

Publish Price Matrix command structure

Parameters

ZbZclPriceServerPublishPriceT

Publish Price command structure

Parameters

ZbZclPriceServerPublishTariffInfoT

Publish Tariff Info command structure

Parameters

9. Tunneling

#include "zcl/se/zcl.tunnel.h"

Functions

ZbZclTunnelClientAddProto

enum ZclStatusCodeT ZbZclTunnelClientAddProto(struct ZbZclClusterT *cluster, enum ZbZclTunnelProtocolT protocol, uint16_t mfr,
uint16_t mtu, struct ZbZclTunnelProtoCbT *callbacks);

Add a protocol tunnel to the server

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelClientAlloc

struct ZbZclClusterT * ZbZclTunnelClientAlloc(struct ZigBeeT *zb, uint8_t endpoint);

Create a new instance of the Tunneling Client cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclTunnelClientCloseQuietReq

enum ZclStatusCodeT ZbZclTunnelClientCloseQuietReq(struct ZbZclClusterT *cluster);

Close the local tunnel without informing the server

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelClientCloseReq

enum ZclStatusCodeT ZbZclTunnelClientCloseReq(struct ZbZclClusterT *cluster, struct ZbZclTunnelCloseT *close,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Close Tunnel command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelClientGetSupportedProtocols

enum ZclStatusCodeT ZbZclTunnelClientGetSupportedProtocols(struct ZbZclClusterT *cluster, struct ZbApsAddrT *dst,
struct ZbZclTunnelGetSupportedProtocolsT *suppported_proto, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Get Supported Protocols command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelClientSendReq

enum ZclStatusCodeT ZbZclTunnelClientSendReq(struct ZbZclClusterT *cluster, struct ZbZclTunnelDataT *data,
void (*callback)(struct ZbZclCommandRspT *rspPr, void *arg), void *arg);

Send a Transfer Data command

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelMirrorAlloc

struct ZbZclClusterT * ZbZclTunnelMirrorAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *tunnel, struct ZbZclClusterT *meter_mirror);

Allocates a Tunneling Client/Server Mirror cluster. The caller (application) must attach any attributes to the cluster you want to mirror.

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclTunnelSendData

enum ZclStatusCodeT ZbZclTunnelSendData(struct ZbZclClusterT *cluster, struct ZbZclTunnelStateT *state, struct ZbZclTunnelDataT *data,
void (*callback)(struct ZbZclCommandRspT *rspPtr, void *arg), void *arg);

Send data via the tunnel. If the input cluster is server then the data will be sent to the client and vice versa.

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelServerAddProto

enum ZclStatusCodeT ZbZclTunnelServerAddProto(struct ZbZclClusterT *cluster, enum ZbZclTunnelProtocolT protocol, uint16_t mfr, uint16_t mtu,
struct ZbZclTunnelProtoCbT *callbacks);

Add a protocol tunnel to the server

Parameters

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclTunnelServerAlloc

struct ZbZclClusterT * ZbZclTunnelServerAlloc(struct ZigBeeT *zb, uint8_t endpoint);

Create a new instance of the Tunneling Server cluster

Parameters

Return

  • Cluster pointer, or NULL if there is an error

ZbZclTunnelServerStateFindById

struct ZbZclTunnelStateT * ZbZclTunnelServerStateFindById(struct ZbZclClusterT *cluster, uint16_t tunnel_id);

Get tunnel server state by tunnel ID

Parameters

Return

  • State of the tunnel

ZbZclTunnelStateGetDataLen

uint32_t ZbZclTunnelStateGetDataLen(struct ZbZclTunnelStateT *state, bool clear_data);

Get received data length using Tunneling Cluster State structure

Parameters

Return

  • Length of data in the buffer

ZbZclTunnelStateGetDataPtr

uint8_t * ZbZclTunnelStateGetDataPtr(struct ZbZclTunnelStateT *state);

Get received data using Tunneling Cluster State structure

Parameters

Return

  • Pointer to received data buffer. Length of data is determined by ZbZclTunnelStateGetDataLen.

ZbZclTunnelStateGetId

uint16_t ZbZclTunnelStateGetId(struct ZbZclTunnelStateT *state);

Get ID using Tunneling Cluster State structure

Parameters

Return

  • Allocated tunnel ID

ZbZclTunnelStateGetMtu

uint16_t ZbZclTunnelStateGetMtu(struct ZbZclTunnelStateT *state);

Get the current tunnel’s MTU, which is the smaller of the two side’s MTUs.

Parameters

Return

  • MTU size in bytes

ZbZclTunnelStateGetProtocol

enum ZbZclTunnelProtocolT ZbZclTunnelStateGetProtocol(struct ZbZclTunnelStateT *state);

Get Tunneling Protocol Instance using Tunneling Cluster State structure

Parameters

Return

  • Tunneling Protocol Instance structure

ZbZclTunnelStateGetRmtAddr

bool ZbZclTunnelStateGetRmtAddr(struct ZbZclTunnelStateT *state, uint64_t *addr, uint8_t *endpoint);

Get the current tunnel’s remote addressing.

Parameters

Return

  • True if address info is present and valid, false otherwise.

Enumerations

ZbZclTunnelProtocolT

Tunneling Protocol ID enumerations

ZbZclTunnelStatusT

Tunneling Status Values

ZbZclTunnelSvrAttrT

Tunneling Server Attribute IDs

ZbZclTunnelXferStatusT

Tunneling Transfer Data Status Values

Structures

ZbZclTunnelCloseT

Close Tunnel command structure

Parameters

ZbZclTunnelConnectT

Request Tunnel command structure

Parameters

ZbZclTunnelDataT

Tunnel Data command structure

Parameters

ZbZclTunnelGetSupportedProtocolsT

Get Supported Protocols command structure

Parameters

ZbZclTunnelProtoCbT

ZbZclTunnelServerAddProto and ZbZclTunnelClientAddProto callback data structure

Parameters