Zigbee Cluster Library Overview 2

1. Identify

#include "zcl/general/zcl.identify.h"

Functions

ZbZclIdentifyClientAlloc

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

Create a new instance of the Identify Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclIdentifyServerAlloc

struct ZbZclClusterT * ZbZclIdentifyServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, const struct zcl_identify_server_callbacks_t *callbacks, void *arg);

Create a new instance of the Identify Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
arg Pointer to application data that will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclIdentifyServerGetTime

uint16_t ZbZclIdentifyServerGetTime(struct ZbZclClusterT *cluster);

Get the local Identify Server time

Parameters

cluster Cluster instance with timer to get

Return

  • uint16_t Time remaining in zigbee timer

ZbZclIdentifyServerSetTime

void ZbZclIdentifyServerSetTime(struct ZbZclClusterT *cluster, uint16_t seconds);

Set the local Identify Server time

If BDB_COMMISSION_MODE_FIND_BIND is enabled and seconds > 0, seconds is adjusted to be >= ZB_BDBC_MinCommissioningTime

Parameters

cluster Cluster instance with timer to set
seconds Seconds for updating the identify time counter

Return

  • Void

zcl_identify_cli_identify_req

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

Send an Identify command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
identify_time Time which will be used to set the IdentifyTime attribute
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_identify_cli_query_req

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

Send an Identify Query command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclIdentifySvrAttrT

Identify Server Attribute IDs

ZCL_IDENTIFY_ATTR_TIME IdentifyTime

2. Illuminance Level Sensing

#include "zcl/general/zcl.illum.level.h"

Functions

ZbZclIllumLevelClientAlloc

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

Create a new instance of the Illuminance Level Sensing Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclIllumLevelServerAlloc

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

Create a new instance of the Illuminance Level Sensing Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclIllumLevelSvrAttrT

Attribute Identifiers

ZCL_ILLUM_LEVEL_ATTR_LEVEL_STATUS LevelStatus
ZCL_ILLUM_LEVEL_ATTR_LIGHT_SENSOR_TYPE LightSensorType
ZCL_ILLUM_LEVEL_ATTR_ILLUM_TARGET_LEVEL IlluminanceTargetLevel

3. Illuminance Measurement

#include "zcl/general/zcl.illum.meas.h"

Functions

ZbZclIllumMeasClientAlloc

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

Create a new instance of the Illuminance Measurement Client cluster

Parameters
zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclIllumMeasServerAlloc

struct ZbZclClusterT * ZbZclIllumMeasServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint16_t min, uint16_t max);

Create a new instance of the Illuminance Measurement Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
min Minimum value capable of being measured (MinMeasuredValue)
max Maximum value capable of being measured (MaxMeasuredValue)

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclIllumMeasSvrAttrT

Illuminance Measurement Server Attribute IDs

ZCL_ILLUM_MEAS_ATTR_MEAS_VAL MeasuredValue
ZCL_ILLUM_MEAS_ATTR_MIN_MEAS_VAL MinMeasuredValue
ZCL_ILLUM_MEAS_ATTR_MAX_MEAS_VAL MaxMeasuredValue
ZCL_ILLUM_MEAS_ATTR_TOLERANCE Tolerance (Optional)
ZCL_ILLUM_MEAS_ATTR_LIGHT_SENSOR_TYPE LightSensorType (Optional)

4. Level

#include "zcl/general/zcl.level.h"

Functions

ZbZclLevelClientAlloc

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

Create a new instance of the Level Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclLevelClientMoveReq

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

Send a Move command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req Move command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclLevelClientMoveToFreqReq

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

Send a Move to Frequency command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req Stop command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclLevelClientMoveToLevelReq

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

Send a Move to Level command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req Move To Level command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclLevelClientStepReq

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

Send a Step command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req Step command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclLevelClientStopReq

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

Send a Stop command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req Stop command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclLevelServerAlloc

struct ZbZclClusterT * ZbZclLevelServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclClusterT *onoff_server,
struct ZbZclLevelServerCallbacksT *callbacks, void *arg);

Create a new instance of the Level Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
onoff_server OnOff server cluster pointer for processing commands with the Options fields. May be NULL
callbacks Structure containing any callback function pointers for this cluster
arg Pointer to application data that will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclLevelSvrAttrT

Level Server Attribute IDs

ZCL_LEVEL_ATTR_CURRLEVEL CurrentLevel
ZCL_LEVEL_ATTR_REMAINTIME RemainingTime (Optional)
ZCL_LEVEL_ATTR_MINLEVEL MinLevel (Optional)
ZCL_LEVEL_ATTR_MAXLEVEL MaxLevel (Optional)
ZCL_LEVEL_ATTR_CURRFREQ CurrentFrequency (Optional)
ZCL_LEVEL_ATTR_MINFREQ MinFrequency (Optional)
ZCL_LEVEL_ATTR_MAXFREQ MaxFrequency (Optional)
ZCL_LEVEL_ATTR_OPTIONS OnOffTransitionTime (Optional)
ZCL_LEVEL_ATTR_ONOFF_TRANS_TIME OnLevel (Optional)
ZCL_LEVEL_ATTR_ONLEVEL OnTransitionTime (Optional)
ZCL_LEVEL_ATTR_ON_TRANS_TIME OffTransitionTime (Optional)
ZCL_LEVEL_ATTR_OFF_TRANS_TIME DefaultMoveRate (Optional)
ZCL_LEVEL_ATTR_DEFAULT_MOVE_RATE Options (Optional)
ZCL_LEVEL_ATTR_STARTUP_CURRLEVEL StartUpCurrentLevel (Optional)

Structures

ZbZclLevelClientMoveReqT

Move command structure

Parameters

bool with_onoff With Onoff - If true then cmd is ZCL_LEVEL_CLI_CMD_MOVE_ONOFF, else ZCL_LEVEL_CLI_CMD_MOVE
uint8_t mode Mode
uint8_t rate Rate
uint8_t mask OptionsMask - Not included if with_onoff is true
uint8_t override OptionsOverride - Not included if with_onoff is true

ZbZclLevelClientMoveToFreqT

Move to Closest Frequency command structure

Parameters

uint16_t freq Frequency

ZbZclLevelClientMoveToLevelReqT

Move To Level command structure

Parameters

bool with_onoff With Onoff - If true then cmd is ZCL_LEVEL_CLI_CMD_MOVE_LEVEL_ONOFF, else ZCL_LEVEL_CLI_CMD_MOVE_LEVEL
uint8_t level Level
uint16_t transition_time Transition time
uint8_t mask OptionsMask - Not included if with_onoff is true
uint8_t override OptionsOverride - Not included if with_onoff is true

ZbZclLevelClientStepReqT

Step command structure

Parameters

bool with_onoff With Onoff - If true then cmd is ZCL_LEVEL_CLI_CMD_STEP_ONOFF, else ZCL_LEVEL_CLI_CMD_STEP
uint8_t mode Mode
uint8_t size Size
uint16_t transition_time Transition Time
uint8_t mask OptionsMask - Not included if with_onoff is true
uint8_t override OptionsOverride - Not included if with_onoff is true

ZbZclLevelClientStopReqT

Stop command structure

Parameters

bool with_onoff With Onoff - If true then cmd is ZCL_LEVEL_CLI_CMD_STOP_ONOFF, else ZCL_LEVEL_CLI_CMD_STOP
uint8_t mask OptionsMask - Not included if with_onoff is true
uint8_t override OptionsOverride - Not included if with_onoff is true

ZbZclLevelServerCallbacksT

Level Server callbacks configuration

Parameters

move_to_level

(callback function pointer)

enum ZclStatusCodeT (*move_to_level)(struct ZbZclClusterT *cluster, struct ZbZclLevelClientMoveToLevelReqT *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Move To Level command. Set with_onoff to true in the req struct when utilizing the onoff cluster on the same endpoint. The application is expected to update the ZCL_LEVEL_ATTR_CURRLEVEL attribute.

move

(callback function pointer)

enum ZclStatusCodeT (*move)(struct ZbZclClusterT *cluster, struct ZbZclLevelClientMoveReqT *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Move command. Set with_onoff to true in the req struct when utilizing the onoff cluster on the same endpoint. The application is expected to update the ZCL_LEVEL_ATTR_CURRLEVEL attribute.

step

(callback function pointer)

enum ZclStatusCodeT (*step)(struct ZbZclClusterT *cluster, struct ZbZclLevelClientStepReqT *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Step command. Set with_onoff to true in the req struct when utilizing the onoff cluster on the same endpoint. The application is expected to update the ZCL_LEVEL_ATTR_CURRLEVEL attribute.

stop

(callback function pointer)

enum ZclStatusCodeT (*stop)(struct ZbZclClusterT *cluster, struct ZbZclLevelClientStopReqT *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Stop command. Set with_onoff to true in the req struct when utilizing the onoff cluster on the same endpoint. The application is expected to update the ZCL_LEVEL_ATTR_CURRLEVEL attribute.

move_to_freq

(callback function pointer)

enum ZclStatusCodeT (*move_to_freq)(struct ZbZclClusterT *cluster, struct ZbZclLevelClientMoveToFreqT *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Move to Frequency command. The application is expected to update the ZCL_LEVEL_ATTR_CURRFREQ attribute.

5. Meter Identification

#include "zcl/general/zcl.meter.id.h"

Functions

ZbZclMeterIdClientAlloc

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

Instantiate a new instance of the Meter Identification Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclMeterIdServerAlloc

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

Instantiate a new instance of the Meter Identification Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclMeterIdSvrAttrT

Attribute Identifiers

ZCL_METER_ID_ATTR_COMPANY_NAME CompanyName
ZCL_METER_ID_ATTR_METER_TYPE_ID MeterTypeID
ZCL_METER_ID_ATTR_DATA_QUAL_ID DataQualityID
ZCL_METER_ID_ATTR_CUSTOMER_NAME CustomerName (Optional)
ZCL_METER_ID_ATTR_MODEL Model (Optional)
ZCL_METER_ID_ATTR_PART_NUMBER PartNumber (Optional)
ZCL_METER_ID_ATTR_PRODUCT_REV ProductRevision (Optional)
ZCL_METER_ID_ATTR_SOFTWARE_REV SoftwareRevision (Optional)
ZCL_METER_ID_ATTR_UTILITY_NAME UtilityName (Optional)
ZCL_METER_ID_ATTR_POD POD
ZCL_METER_ID_ATTR_AVAILABLE_POWER AvailablePower
ZCL_METER_ID_ATTR_POWER_THRESH PowerThreshold

6. Nearest Gateway

#include "zcl/general/zcl.nearest.gw.h"

Functions

ZbZclNearestGwClientAlloc

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

Instantiate a new instance of the Nearest Gateway client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclNearestGwServerAlloc

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

Instantiate a new instance of the Nearest Gateway server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclNearestGwServerAttrT

Nearest Gateway Attribute Ids

ZCL_NEAREST_GW_SVR_ATTR_NEAREST_GW Nearest Gateway
ZCL_NEAREST_GW_SVR_ATTR_NEW_MOBILE_NODE New Mobile Node

7. Occupancy Sensing

#include "zcl/general/zcl.occupancy.h"

Functions

ZbZclOccupancyClientAlloc

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

Create a new instance of the Occupancy Sensing Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOccupancyServerAlloc

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

Create a new instance of the Occupancy Sensing Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclOccupancySvrAttrT

Occupancy Sensing Server Attribute IDs

ZCL_OCC_ATTR_OCCUPANCY Occupancy
ZCL_OCC_ATTR_SENSORTYPE OccupancySensorType
ZCL_OCC_ATTR_SENSORTYPE_BITMAP OccupancySensorTypeBitmap
ZCL_OCC_ATTR_PIR_OU_DELAY PIROccupiedToUnoccupiedDelay (Optional)
ZCL_OCC_ATTR_PIR_UO_DELAY PIRUnoccupiedToOccupiedDelay (Optional)
ZCL_OCC_ATTR_PIR_UO_THRESHOLD PIRUnoccupiedToOccupiedThreshold (Optional)
ZCL_OCC_ATTR_US_OU_DELAY UltrasonicOccupiedToUnoccupiedDelay (Optional)
ZCL_OCC_ATTR_US_UO_DELAY UltrasonicUnoccupiedToOccupiedDelay (Optional)
ZCL_OCC_ATTR_US_UO_THRESHOLD UltrasonicUnoccupiedToOccupiedThreshold (Optional)
ZCL_OCC_ATTR_PHY_OU_DELAY PhysicalContactOccupiedToUnoccupiedDelay (Optional)
ZCL_OCC_ATTR_PHY_UO_DELAY PhysicalContactUnoccupiedToOccupiedDelay (Optional)
ZCL_OCC_ATTR_PHY_UO_THRESHOLD PhysicalContactUnoccupiedToOccupiedThreshold (Optional)

8. On/Off Switch Configuration

#include "zcl/general/zcl.onoff.swconfig.h"

Functions

ZbZclOnOffSwConfigClientAlloc

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

Create a new instance of the OnOff Switch Configuration Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOnOffSwConfigServerAlloc

struct ZbZclClusterT * ZbZclOnOffSwConfigServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint8_t switch_type);

Create a new instance of the OnOff Switch Configuration Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
switch_type Type of switch associated with this cluster server

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclOnOffSwConfigSvrAttrId

Onoff Switch Configuration cluster attribute IDs

ZCL_ONOFF_SWCONFIG_ATTR_TYPE SwitchType
ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS SwitchActions

9. On/Off

#include "zcl/general/zcl.onoff.h"

Functions

ZbZclOnOffClientAlloc

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

Create a new instance of the OnOff Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOnOffClientOffReq

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

Send an Off command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when response is received
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOnOffClientOnReq

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

Send an On command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when response is received
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOnOffClientToggleReq

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

Send a Toggle command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when response is received
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOnOffServerAlloc

struct ZbZclClusterT * ZbZclOnOffServerAlloc(struct ZigBeeT *zb, uint8_t endpoint,
struct ZbZclOnOffServerCallbacksT *callbacks, void *arg);

Create a new instance of the OnOff Server cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOnOffServerSetLevelControlCallback

void ZbZclOnOffServerSetLevelControlCallback(struct ZbZclClusterT *on_off_cluster, struct ZbZclClusterT
*level_cluster, ZbZclLevelControlCallbackT levelControlCallback);

Set the Level control callback

Parameters

on_off_cluster OnOff cluster instance
level_cluster Level cluster instance
levelControlCallback Level control callback function

Return

  • Void

Enumerations

ZbZclOnOffSvrAttrT

OnOff Server Attribute IDs

ZCL_ONOFF_ATTR_ONOFF OnOff
ZCL_ONOFF_ATTR_GLOBAL_SCENE_CONTROL GlobalSceneControl (Optional)
ZCL_ONOFF_ATTR_ON_TIME OnTime (Optional)
ZCL_ONOFF_ATTR_OFF_WAIT_TIME OffWaitTime (Optional)

Structures

ZbZclOnOffServerCallbacksT

OnOff Server callbacks configuration

Parameters

off

(callback function pointer)

enum ZclStatusCodeT (*off)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of an Off command. The application is expected to update ZCL_ONOFF_ATTR_ONOFF.

on

(callback function pointer)

enum ZclStatusCodeT (*on)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of an On command. The application is expected to update ZCL_ONOFF_ATTR_ONOFF.

toggle

(callback function pointer)

enum ZclStatusCodeT (*toggle)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of a Toggle command. The application is expected to update ZCL_ONOFF_ATTR_ONOFF.

10. Over-The-Air Upgrade

#include "zcl/general/zcl.ota.h"

Functions

ZbZclOtaClientAlloc

struct ZbZclClusterT * ZbZclOtaClientAlloc(struct ZigBeeT *zb, struct ZbZclOtaClientConfig *config, void *arg);

Create a new instance of the OTA Upgrade Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
config Pointer to OTA client configuration structure
arg Pointer to application data provided in initiating API call

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOtaClientDiscover

enum ZclStatusCodeT ZbZclOtaClientDiscover(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *addr);

Discover OTA Upgrade Server

Parameters

cluster Cluster instance from which to send this command
addr Destination address for discovery

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOtaClientDiscoverForced

void ZbZclOtaClientDiscoverForced(struct ZbZclClusterT *cluster, uint64_t ieee, uint8_t endpoint);

Set the OTA Upgrade Server directly (without discovery)

Parameters

cluster Cluster instance from which to send this command
ieee OTA Upgrade server IEEE address
endpoint Endpoint on which to create cluster

Return

  • None

ZbZclOtaClientGetDefaultCallbacks

void ZbZclOtaClientGetDefaultCallbacks(struct ZbZclOtaClientCallbacksT *callbacks);

Load the default callbacks for ECDSA Suite 2 support

Parameters

callbacks Structure containing any callback function pointers for this cluster

Return

  • None

ZbZclOtaClientImageTransferResume

enum ZclStatusCodeT ZbZclOtaClientImageTransferResume(struct ZbZclClusterT *cluster);

Resume an OTA Upgrade transfer. ZbZclOtaClientImageTransferResume is called if the NHLE (app) returned ZCL_STATUS_WAIT_FOR_DATA for the write_image callback. The OTA Client won’t request the next block of data in this case, until this function is called.

Parameters

cluster Cluster instance from which to send this command

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOtaClientImageTransferStart

enum ZclStatusCodeT ZbZclOtaClientImageTransferStart(struct ZbZclClusterT *cluster);

Initiate an OTA Upgrade transfer.

Parameters

cluster Cluster instance from which to send this command

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOtaClientQueryNextImageReq

enum ZclStatusCodeT ZbZclOtaClientQueryNextImageReq(struct ZbZclClusterT *cluster, struct ZbZclOtaImageDefinition
*image_definition, uint8_t field_control, uint16_t hardware_version);

Send a Query Next Image Request command. If a response is received, or an error occurs, the 'query_next' callback is invoked to the application.

Parameters

cluster Cluster instance from which to send this command
image_definition OTA Header Image Definition structure (See 'struct ZbZclOtaImageDefinition')
field_control Field Control
hardware_version Hardware Version to include in request, unless set to 0xff.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

ZbZclOtaHeaderParse

uint8_t ZbZclOtaHeaderParse(const uint8_t *payload, const uint8_t length, struct ZbZclOtaHeader *header);

Parse an OTA Upgrade payload buffer’s header information

Parameters

payload OTA Upgrade Payload buffer
length Length of OTA Upgrade Payload
header OTA Upgrade Header Fields structure

Return

  • Number of bytes parsed

ZbZclOtaServerAlloc

struct ZbZclClusterT * ZbZclOtaServerAlloc(struct ZigBeeT *zb, struct ZbZclOtaServerConfig
  • config, void *arg);

Create a new instance of the OTA Upgrade Server cluster

Parameters

zb Zigbee stack instance
config OTA Upgrade Server Configuration structure
arg Pointer to application data that will later be provided back to the callback function when invoked

Return

  • Cluster pointer, or NULL if there is an error

ZbZclOtaServerImageNotifyReq

enum ZclStatusCodeT ZbZclOtaServerImageNotifyReq(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
uint8_t payload_type, uint8_t jitter, struct ZbZclOtaImageDefinition *image_definition);

Send an OTA Image Notify Server command Registering an image does not automatically send an Image Notify message, the OTA Server application can use ZbZclOtaServerImageNotifyReq after registering an image to notify clients of the availability of a new image

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
payload_type Payload Type
jitter Jitter
image_definition OTA Header Image Definition structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclOtaServerUpgradeEndRespUnsolic

enum ZclStatusCodeT ZbZclOtaServerUpgradeEndRespUnsolic(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclOtaImageDefinition *image_definition, struct ZbZclOtaEndResponseTimes *end_response_times);

Send an Unsolicited OTA Upgrade End Response. This command is sent at some point in time after receiving the Upgrade End Request, which was already responsed to by a Default Response. This should be the normal way to handle the Upgrade End commands, rather than the Solicated Upgrade End Response (ZbZclOtaServerUpgradeEndRespSolic).

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
image_definition OTA Header Image Definition
end_response_times Upgrade End Response command

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclOtaActivationPolicy

OTA Upgrade UpgradeActivationPolicy enumerations

ZCL_OTA_ACTIVATION_POLICY_SERVER OTA Server Activation Allowed
ZCL_OTA_ACTIVATION_POLICY_OUT_OF_BAND Out-of-band Activation Only

ZbZclOtaHeaderFieldCtrlBitmask

OTA Upgrade Header Field Control Bitmask enumerations

ZCL_OTA_HEADER_FIELD_CONTROL_SECURITY_VERSION Security Credential Version Present
ZCL_OTA_HEADER_FIELD_CONTROL_DEVICE_SPECIFIC Device Specific File
ZCL_OTA_HEADER_FIELD_CONTROL_HARDWARE_VERSI ONS Hardware Versions Present

ZbZclOtaImageBlkReqFldCtrl

OTA Upgrade Image Block Request Field Control Bitmask enumerations

ZCL_OTA_IMAGE_BLOCK_FC_IEEE Request node’s IEEE address Present
ZCL_OTA_IMAGE_BLOCK_FC_MIN_PERIOD MinimumBlockPeriod present

ZbZclOtaImageNotifyCmd

OTA Upgrade Image Notify Command Payload enumerations

ZCL_OTA_NOTIFY_TYPE_JITTER Query jitter
ZCL_OTA_NOTIFY_TYPE_MFG_CODE Query jitter and manufacturer code
ZCL_OTA_NOTIFY_TYPE_IMAGE_TYPE Query jitter, manufacturer code, and image type
ZCL_OTA_NOTIFY_TYPE_FILE_VERSION Query jitter, manufacturer code, image type, and new file version

ZbZclOtaImageType

OTA Upgrade Image Types enumerations

ZCL_OTA_IMAGE_TYPE_MFG_MIN Manufacturer Specific (start)
ZCL_OTA_IMAGE_TYPE_MFG_MAX Manufacturer Specific (end)
ZCL_OTA_IMAGE_TYPE_CLI_SECURITY_CRED Client Security credentials
ZCL_OTA_IMAGE_TYPE_CLI_CONFIG Client Configuration
ZCL_OTA_IMAGE_TYPE_SERVER_LOG Server Log
ZCL_OTA_IMAGE_TYPE_PICTURE Picture
ZCL_OTA_IMAGE_TYPE_WILDCARD Wild Card

ZbZclOtaQueryFldCtrlHwVer

OTA Upgrade Field Control Hardware Version enumerations

ZCL_OTA_QUERY_FIELD_CONTROL_HW_VERSION Hardware Version

ZbZclOtaSecCredential

OTA Upgrade Security Credential Version enumerations

ZCL_OTA_SEC_CRED_SE_1_0 SE 1.0
ZCL_OTA_SEC_CRED_SE_1_1 SE 1.1
ZCL_OTA_SEC_CRED_SE_2_0 SE 2.0
ZCL_OTA_SEC_CRED_SE_1_2 SE 1.2

ZbZclOtaStackVersion

OTA Upgrade Zigbee Stack Version Values

ZCL_OTA_STACK_VERSION_2006 ZigBee 2006
ZCL_OTA_STACK_VERSION_2007 ZigBee 2007
ZCL_OTA_STACK_VERSION_PRO ZigBee Pro
ZCL_OTA_STACK_VERSION_IP ZigBee IP

ZbZclOtaStatus

OTA Upgrade Status Attribute Values (ImageUpgradeStatus)

ZCL_OTA_STATUS_NORMAL Normal
ZCL_OTA_STATUS_DOWNLOAD_IN_PROGRESS Download in progress
ZCL_OTA_STATUS_DOWNLOAD_COMPLETE Download complete
ZCL_OTA_STATUS_WAITING_TO_UPGRADE Waiting to upgrade
ZCL_OTA_STATUS_COUNT_DOWN Count down
ZCL_OTA_STATUS_WAIT_FOR_MORE Wait for more
ZCL_OTA_STATUS_WAIT_UPGRADE_EXT Waiting to Upgrade via External Event

ZbZclOtaSubElementTag

OTA Upgrade Tag Identifiers enumerations

ZCL_OTA_SUB_TAG_UPGRADE_IMAGE Upgrade Image
ZCL_OTA_SUB_TAG_ECDSA_SIG1 ECDSA Signature (Crypto Suite 1)
ZCL_OTA_SUB_TAG_ECDSA_CERT_1 ECDSA Signing Certificate (Crypto Suite 1)
ZCL_OTA_SUB_TAG_IMAGE_INTEGRITY_CODE Image Integrity Code
ZCL_OTA_SUB_TAG_PICTURE_DATA Picture Data
ZCL_OTA_SUB_TAG_ECDSA_SIG2 ECDSA Signature (Crypto Suite 2)
ZCL_OTA_SUB_TAG_ECDSA_CERT_2 ECDSA Signing Certificate (Crypto Suite 2)

ZbZclOtaSvrAttrId

OTA Upgrade Server Attribute IDs

ZCL_OTA_ATTR_UPGRADE_SERVER_ID UpgradeServerID
ZCL_OTA_ATTR_FILE_OFFSET FileOffset (Optional).

When writing a non-zero value to ZCL_OTA_ATTR_FILE_OFFSET, the entire OTA Header must have already been received by this cluster. This can be used to resume a transfer that was interrupted by the local device being power cycled in the middle of an OTA download. The procedure in this case is to start the transfer over (ZbZclOtaClientImageTransferStart) and during the first write_image() callback to the application, you write a new value to the FileOffset attribute before returning from the callback. The OTA Client will then request the next block starting from the new FileOffset.

During the write_image() callback, the application can also compare that the current OTA header matches the previous one, if saved before the reset.

If relying on the Integrity Code (hash), the application must define it’s own image_validate() callback. This is because data that has already been saved to NVM will be skipped by the OTA Client after the reset, so the running hash is no longer valid.

ZCL_OTA_ATTR_CURRENT_FILE_VERSION CurrentFileVersion (Optional)
ZCL_OTA_ATTR_CURRENT_STACK_VERSION CurrentZigBeeStackVersion (Optional)
ZCL_OTA_ATTR_DOWNLOAD_FILE_VERSION DownloadedFileVersion (Optional)
ZCL_OTA_ATTR_DOWNLOAD_STACK_VERSION DownloadedZigBeeStackVersion (Optional)
ZCL_OTA_ATTR_IMAGE_UPGRADE_STATUS ImageUpgradeStatus (Optional).

Writing ZCL_OTA_STATUS_NORMAL (0) to this attribute will reset the cluster back to defaults.

ZCL_OTA_ATTR_MANUFACTURER_ID ManufacturerID (Optional)
ZCL_OTA_ATTR_IMAGE_TYPE_ID ImageTypeID (Optional)
ZCL_OTA_ATTR_MIN_BLOCK_PERIOD MinimumBlockPeriod (Optional)
ZCL_OTA_ATTR_IMAGE_STAMP ImageStamp (Optional)
ZCL_OTA_ATTR_UPGRADE_ACTIVATION_POLICY UpgradeActivationPolicy (Optional)
ZCL_OTA_ATTR_UPGRADE_TIMEOUT_POLICY UpgradeTimeoutPolicy (Optional)

ZbZclOtaTimeoutPolicy

OTA Upgrade UpgradeTimeoutPolicy enumerations

ZCL_OTA_TIMEOUT_POLICY_APPLY_UPGRADE Apply Upgrade After Timeout
ZCL_OTA_TIMEOUT_POLICY_DO_NOT_APPLY Do not Apply Upgrade After Timeout

Structures

ZbZclOtaClientCallbacksT

OTA Upgrade callbacks configuration

Parameters

discover_complete

(callback function pointer)

void (*discover_complete)(struct ZbZclClusterT *cluster, enum ZclStatusCodeT status, void *arg)

Callback to Server, invoked on discovery of OTA Upgrade Server. If NULL and ZbZclOtaClientDiscover is successful, the default handler will automatically call ZbZclOtaClientQueryNextImageReq.

image_notify

(callback function pointer)

enum ZclStatusCodeT (*image_notify)(struct ZbZclClusterT *cluster, uint8_t payload_type, uint8_t jitter, struct ZbZclOtaImageDefinition *image_definition, struct ZbApsdeDataIndT *data_ind, struct ZbZclHeaderT *zcl_header)

Callback to Server, invoked on receipt of Image Notify Server command If NULL, the OTA Client has default callback handlers to take care of a typical OTA firmware upgrade file.

Callback Function Parameters:

  • payload_type

The value of the payload type from the Image Notify command payload. The value indicates which parameters in the image_definition are valid.

  • 0x00 = Query Jitter
  • 0x01 = Query Jitter, Manufacturer Code
  • 0x02 = Query Jitter, Manufacturer Code, Image Type
  • 0x03 = Query Jitter, Manufacturer Code, Image Type, File Version
  • jitter

The value of the query jitter from the Image Notify command payload. The jitter is used to decide if the client should drop the command or not. Refer to section 11.13.3.4 (Effect on Receipt) of the ZCL6 spec.

  • image_definition

Pointer to the parsed image definition of the image from the Image notify payload.

  • manufacturer_code

The manufacturer code for this image.

  • image_type

The manufacturer specific image type, defined by the manufacturer.

  • file_version

The file version.

  • data_ind

Pointer to the incoming APSDE-DATA.indication struct.

  • zcl_header

Pointer to the incoming ZCL Header struct.

query_next

(callback function pointer)

void (*query_next)(struct ZbZclClusterT *cluster, enum ZclStatusCodeT status, struct ZbZclOtaImageDefinition image_definition, uint32_t image_size, void *arg)

Callback to Server, invoked on receipt of Query Next Image Response command. If no image was found, the status will be set to ZCL_STATUS_NO_IMAGE_AVAILABLE. Otherwise the status should be set to ZCL_STATUS_SUCCESS from the OTA Server.

update_raw

(callback function pointer)

enum ZclStatusCodeT (*update_raw)(struct ZbZclClusterT *cluster, uint8_t length, uint8_t *data, void *arg)

Raw image data is sent through this callback, to update running hash of image for example. Normally, this callback should be left to use the cluster’s default internal handler, but if the application does define its own callback, it must also provide its own handler for the 'image_validate' callback. Return code is ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error (e.g. ZCL_STATUS_FAILURE).

Callback Function Parameters:

  • length

The length of the data to be written in this invocation

  • data

The data to be written

write_tag

(callback function pointer)

enum ZclStatusCodeT (*write_tag)(struct ZbZclClusterT *cluster, struct ZbZclOtaHeader *header, uint16_t tag_id, uint32_t tag_length, uint8_t data_length, uint8_t *data, void *arg)

Callback to write tag sub-element information. Normally this is left as-is after the cluster is allocated to use the default internal callback handler. The default handler will call the 'write_image' callback to process any image tag data (i.e. the actual firmware binary).

Callback Function Parameters:

  • header

A pointer to the OTA header from the start of the transferred, see Table 11-2 OTA Header Fields in the OTA spec

  • tag_id

The tag id for the data to be written, see Table 11-9 Tag Identifiers

  • tag_length

The total length of data assocated with this tag. This value will remain constant for a given image for each tag id

  • data_length

The length of the data to be written in this invocation

  • data

The data to be written

Return Code:

ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error (e.g. ZCL_STATUS_FAILURE).

write_image

(callback function pointer)

enum ZclStatusCodeT (*write_image)(struct ZbZclClusterT *cluster, struct ZbZclOtaHeader *header, uint8_t length, uint8_t *data, void *arg)

If not NULL, this is called by the cluster’s default 'write_tag' handler for ZCL_OTA_SUB_TAG_UPGRADE_IMAGE data. If the application has provided its own 'write_tag' handler, then this callback is not used.

Callback Function Parameters:

  • header

A pointer to the OTA header.

  • length

The length of the data to be written in this invocation

  • data

The data to be written

Return Code:

  • ZCL_STATUS_SUCCESS : request the next block
  • ZCL_STATUS_WAIT_FOR_DATA : wait before requesting the next block.
  • ZCL_STATUS_FAILURE : abort the OTA download
integrity_code

(callback function pointer)

void (*integrity_code)(struct ZbZclClusterT *cluster, struct ZbZclOtaHeader *header, uint8_t length, uint8_t *data, void *arg)

If not NULL, this is called upon reception of the IMAGE_INTEGRITY_CODE sub-tag field. The 'data' parameter will contain the 16-byte hash value. This is used in conjunction with the 'update_raw' callback, which is called for all data up to just before the IMAGE_INTEGRITY_CODE sub-tag.

image_validate

(callback function pointer)

enum ZclStatusCodeT (*image_validate)(struct ZbZclClusterT *cluster, struct ZbZclOtaHeader *header, void *arg)

If not NULL, this is called to validate the image, such as the hash. If NULL, and the image is verified using a Security Certificate, the application must provide a valid ca_pub_key_array parameter in ZbZclOtaClientConfig at initialization. Return code is ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error (e.g. ZCL_STATUS_FAILURE).

Callback Function Parameters:

header

A pointer to the OTA header from the start of the transferred, see Table 11-2 OTA Header Fields in the OTA specification.

Return Code:

  • ZCL_STATUS_SUCCESS

The the image has passed validation and the upgrade is ready to proceed.

  • ZCL_STATUS_INVALID_IMAGE

Validation of the image has failed

  • ZCL_STATUS_REQUIRE_MORE_IMAGE

This image has passed validation, but this device requires more images which are yet to be received before performing an upgrade. The application will need to use one of the CheckForUpdate API calls to locate then transfer the remaining images. When all images have been successfully transferred and validated a SUCCESS status should should be returned instead.

  • ZCL_STATUS_ABORT

The client is aborting the upgrade.

These status codes are used to notify the OTA server of the completion of the transfer via the UpgradeEnd message.

upgrade_end

(callback function pointer)

enum ZclStatusCodeT (*upgrade_end)(struct ZbZclClusterT *cluster, struct ZbZclOtaHeader *header, uint32_t current_time, uint32_t upgrade_time, void *arg)

Callback to handle an Upgrade End Response command, which specifies the time to perform the reboot and start using the updated firmware. If using the default callback handler defined by ZbZclOtaClientGetDefaultCallbacks, the 'reboot' callback will be called when the transfer has completed succesfully and it’s time for the upgrade to take place. If the application has selected the "Out-of-band" Activation Policy, then it’s best for the application to define its own 'upgrade_end' callback to decide when to perform the upgrade.

The callback should update the ZCL_OTA_ATTR_IMAGE_UPGRADE_STATUS attribute accordingly. Writing ZCL_OTA_STATUS_NORMAL to the ZCL_OTA_ATTR_IMAGE_UPGRADE_STATUS attribute will reset the cluster back to defaults.

If the callback returns ZCL_STATUS_SUCCESS, the cluster data is not reset, since the OTA upgrade may be waiting to finish through an external event or timeout. Return code is ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error (e.g. ZCL_STATUS_FAILURE).

If the callback returns an error, the cluster is reset back to defaults.

Callback Function Parameters:

  • header A pointer to the OTA header from the start of the transferred, see Table 11-2 OTA Header Fields in the OTA spec
  • current_time Current time of the server from the upgrade end response payload.
  • upgrade_time Upgrade time from the upgrade end response payload.
reboot

(callback function pointer)

void (*reboot)(struct ZbZclClusterT *cluster, void *arg)

If using the default 'upgrade_end' handler, then a callback must be provided by the application. This is called by the 'upgrade_end' handler if the OTA download was successful, to indicate it is now time to reboot the system.

abort_download

(callback function pointer)

enum ZclStatusCodeT (*abort_download)(struct ZbZclClusterT *cluster, enum ZbZclOtaCommandId commandId, void *arg)

Callback to inform application of a problem with the download. It gives the application the option to perform network diagnostics or repairs (e.g. NWK Route Discovery) before attempting to restart the OTA transfer where it left off. The application can also tell the OTA Client to abort this transfer by returning ZCL_STATUS_SUCCESS. This callback cannot be set to NULL.

The commandId is the OTA command responsible for aborting the transmission (e.g. ZCL_OTA_COMMAND_IMAGE_BLOCK_RESPONSE).

If the application returns ZCL_STATUS_SUCCESS, the OTA transfer will be aborted and cluster reset to defaults, ready for a new transfer. If the application returns an error (i.e. ZCL_STATUS_FAILURE), the OTA transfer will be paused rather than aborted, and can be resumed by the application calling ZbZclOtaClientImageTransferResume.

Callback Function Parameters:

  • commandId

The associated command responsible for this callback. E.g. Image Block Request (0x04) if there was a problem sending the command to retrieve more data, or Image Block Response (0x05) if the block response contained the ABORT status code.

Return Code:

  • ZCL_STATUS_SUCCESS

The OTA transfer will be aborted and cluster reset to defaults, ready for a new transfer.

  • ZCL_STATUS_FAILURE

The OTA transfer will be paused rather than aborted, and can be resumed by the application calling ZbZclOtaClientImageTransferResume. The application may use this opportunity to perform a Route Discovery of the OTA Server or try to poll the OTA Server until it comes back online and communication is able to resume. Refer to the Resume a Partial Download section for more information.

ZbZclOtaClientConfig

OTA Upgrade Client Configuration structure

Parameters

uint16_t profile_id Profile ID
uint8_t endpoint Endpoint on which the cluster is created on
enum ZbZclOtaActivationPolicy

activation_policy

Activation Policy
enum ZbZclOtaTimeoutPolicy

timeout_policy

Timeout Policy - Value written to ZCL_OTA_ATTR_UPGRADE_TIMEOUT_POLICY
uint32_t image_block_delay Image block delay - milliseconds
struct ZbZclOtaHeader current_image OTA Upgrade Header Fields structure. This is used to configure the client’s attributes that describe the firmware image currently running on the device.
uint16_t hardware_version Revision (0x00NN). Included in the Query Next Image command.
const uint8_t *ca_pub_key_array CA Public Key array
unsigned int ca_pub_key_len CA Public Key array length
struct ZbZclOtaClientCallbacksT

callbacks

Client callback functions

ZbZclOtaEndResponseTimes

Upgrade End Response command structure

Parameters

uint32_t current_time Current time
uint32_t upgrade_time Upgrade time

ZbZclOtaHeader

OTA Upgrade Header Fields structure

Parameters

uint32_t file_identifier OTA Upgrade file identifier
uint16_t header_version OTA Header version
uint16_t header_length OTA Header length
uint16_t header_field_control OTA Header Field control
uint16_t manufacturer_code Manufacturer code
uint16_t image_type Image type
uint32_t file_version File version
uint16_t stack_version Zigbee Stack version
uint8_t header_string OTA Header string
uint32_t total_image_size Total Image size (including header)
uint8_t sec_credential_version Security credential version (Optional)
uint64_t file_destination Upgrade file destination (Optional)
uint16_t min_hardware_version Minimum hardware version (Optional)
uint16_t max_hardware_version Maximum hardware version (Optional)

ZbZclOtaImageData

OTA Upgrade Image Data structure

Parameters

uint32_t file_offset File Offset
uint8_t data_size Data Size
uint8_t data Data

ZbZclOtaImageDefinition

OTA Header Image Definition structure

Parameters

uint16_t manufacturer_code Manufacturer code
uint16_t image_type Image type
uint32_t file_version File version

ZbZclOtaImageWaitForData

Image Block Response Command Payload with WAIT_FOR_DATA status structure

Parameters

uint32_t current_time Current time
uint32_t request_time Request time
uint16_t minimum_block_period MinimumBlock Period

ZbZclOtaServerConfig

OTA Upgrade Server Configuration structure

Parameters

uint16_t profile_id Profile ID
uint8_t endpoint Endpoint on which the cluster is created on
uint16_t minimum_block_period Minimum block period
uint32_t upgrade_end_current_time Upgrade End Current Time
uint32_t upgrade_end_upgrade_time Upgrade End Upgrade Time
ZbZclOtaServerImageEvalT image_eval Callback to determine if a suitable image exists
ZbZclOtaServerImageReadT image_read Callback read image data from the server
ZbZclOtaServerUpgradeEndReqT

image_upgrade_end_req

Callback to handle client Upgrade End request
void *arg Pointer to application data that will later be provided back to the callback function when invoked

11. Poll Control

#include "zcl/general/zcl.poll.control.h"

Description

ZCL 8 section 3.16

A Sleepy End Device (SED) may instantiate the Poll Control server to allow external devices to control its polling behaviour, including a short interval of rapid polling in order to communicate with the SED in a timely fashion. SEDs are usually in their sleep state where they are not able to receive packets, and devices may not know when those SEDs are awake and polling for data. The Poll Control cluster is used to solve this dilemma.

Devices with Poll Control clients can use Finding & Binding to create the bindings necessary to communicate with the Poll Control servers. The Poll Control server will perform periodic check-ins with any bound Poll Control clients, where the check-in response may ask the SED to start fast polling to allow the server device to exchange messages with it.


Functions

zcl_poll_client_alloc

struct ZbZclClusterT * zcl_poll_client_alloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPollControlClientCallbackT *callbacks, void *arg);

Create a new instance of the Poll Control Client cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

zcl_poll_client_set_checkin_rsp

enum ZclStatusCodeT zcl_poll_client_set_checkin_rsp(struct ZbZclClusterT *cluster, struct ZbZclPollControlClientCheckinInfo *info);

Set Check-in Response configuration

Parameters

cluster Cluster instance from which to send this command
info Check-in configuration info

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_poll_client_set_long_intvl_req

enum ZclStatusCodeT zcl_poll_client_set_long_intvl_req(struct ZbZclClusterT *cluster, struct ZbZclPollControlClientSetLongReq *req,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Long Interval command

Parameters

cluster Cluster instance from which to send this command
req Set Long Interval command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_poll_client_set_short_intvl_req

enum ZclStatusCodeT zcl_poll_client_set_short_intvl_req(struct ZbZclClusterT *cluster, struct ZbZclPollControlClientSetShortReq *req,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Set Short Interval command

Parameters

cluster Cluster instance from which to send this command
req Set Short Interval command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_poll_client_stop_fastpoll_req

enum ZclStatusCodeT zcl_poll_client_stop_fastpoll_req(struct ZbZclClusterT *cluster, struct ZbZclPollControlClientStopReq *req,
void (*callback)(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Fast Poll Stop command

Parameters

cluster Cluster instance from which to send this command
req Fast Poll Stop command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_poll_server_alloc

struct ZbZclClusterT * zcl_poll_server_alloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPollControlServerCallbackT *callbacks, void *arg);

Create a new instance of the Poll Control Server cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

zcl_poll_server_send_checkin

enum ZclStatusCodeT zcl_poll_server_send_checkin(struct ZbZclClusterT *cluster);

Send a Check-in command to any bound Clients.

Parameters

cluster Cluster instance from which to send this command

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclPollControlSvrAttrT

Poll Control Server Attribute IDs

ZCL_POLL_CHECK_IN_INTERVAL Check-inInterval. Range is (0, 0x6E0000), where 0 means disabled. 0x6E0000 = 7208960 qs = ~500 hours. Other than 0, the Min value is also governed by ZCL_POLL_CHECK_IN_INTERVAL_MIN.
ZCL_POLL_LONG_POLL_INTERVAL LongPollInterval. Range is (0x04, 0x6E0000) = (1 sec, ~500 hours). Min value is also governed by the value of ZCL_POLL_LONG_POLL_INTERVAL_MIN.
ZCL_POLL_SHORT_POLL_INTERVAL ShortPollInterval. Range is (1, 4) = (250 ms, 1 sec)
ZCL_POLL_FAST_POLL_TIMEOUT FastPollTimeout. Range is (0x0001, 0xffff) = (250 ms, 4.55 hours). Max value is also governed by the value of ZCL_POLL_FAST_POLL_TIMEOUT_MAX.
ZCL_POLL_CHECK_IN_INTERVAL_MIN Check-inIntervalMin (Optional). Range is (0, 0x6E0000)
ZCL_POLL_LONG_POLL_INTERVAL_MIN LongPollIntervalMin (Optional). Range is (0x4, 0x6E0000)
ZCL_POLL_FAST_POLL_TIMEOUT_MAX FastPollTimeoutMax (Optional). Range is (0x2, 0xffff)
ZCL_POLL_LONG_POLL_FROM_CLUSTER If True, the Poll Server cluster will perform the NLME- SYNC.request (polling) at the interval given by the 'LongPollInterval' (ZCL_POLL_LONG_POLL_INTERVAL). If False, the Poll Server will only expose the 'LongPollInterval' via the attribute to devices that want to read it, but the application will be responsible for any long polling it wants to do. Default is False (disabled), meaning the cluster will not perform an NLME- SYNC.request at the long poll intervals.
ZCL_POLL_CHECK_IN_RSP_WAIT_AFTER If True, then wait for the full check-in response timeout before stopping fast-polling for responses. If False, then as soon as the number of received check-in responses matches the number of bound clients, then stop fast-polling immediately. Note that this is an Exegin custom attribute and not exposed to the network.

Structures

ZbZclPollControlClientCallbackT

Poll Control Client callbacks configuration

Parameters

checkin_rsp_callback

(callback function pointer)

enum ZclStatusCodeT (*checkin_rsp_callback)(struct ZbZclClusterT *clusterPtr, struct zcl_poll_checkin_rsp_t *rsp_info, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of Check-in Response command

ZbZclPollControlClientCheckinInfo

Check-in Info structure

Parameters

struct ZbApsAddrT dst Destination Address
bool start_fast_poll Start Fast Poll
uint16_t fast_poll_timeout Fast Poll Timeout
bool auto_refresh If true, check-in response is automatically refreshed for the next check-in request. If false, this is a one-time event.

ZbZclPollControlClientSetLongReq

Set Long Poll Interval command structure

Parameters

struct ZbApsAddrT dst Destination Address
uint32_t interval NewLongPollInterval

ZbZclPollControlClientSetShortReq

Set Short Poll Interval command structure

Parameters

struct ZbApsAddrT dst Destination Address
uint16_t interval New Short Poll Interval

ZbZclPollControlClientStopReq

Fast Poll Stop command structure

Parameters

struct ZbApsAddrT dst Destination Address

ZbZclPollControlServerCallbackT

Poll Control Server callbacks configuration

Parameters

checkin_rsp

(callback function pointer)

bool (*checkin_rsp)(struct ZbZclClusterT *clusterPtr, struct zcl_poll_checkin_rsp_t *rsp_info, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of Check-in Response command. If the callback returns true, then the Check-in Response is allowed to start fast polling. The ZCL8 Spec makes it optional whether these commands allow the device to start fast polling, even if "Start Fast Polling" payload parameter is set to true. If the callback return false, then this command shall not have an effect on fast polling.

zcl_poll_checkin_rsp_t

Check-in Response command structure

Parameters

enum ZclStatusCodeT status Status
bool start_fast_poll Start Fast Polling
uint16_t fast_poll_timeout Fast Poll Timeout

12. Power Configuration

#include "zcl/general/zcl.power.config.h"

Functions

ZbZclPowerConfigClientAlloc

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

Create a new instance of the Power Configuration Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPowerConfigServerAlloc

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

Create a new instance of the Power Configuration Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclPowerConfigSvrAttrT

Power Configuration Server Attributes IDs

ZCL_POWER_CONFIG_ATTR_MAINS_VOLTAGE MainsVoltage (Optional)
ZCL_POWER_CONFIG_ATTR_MAINS_FREQ MainsFrequency (Optional)
ZCL_POWER_CONFIG_ATTR_MAINS_ALARM_MASK MainsAlarmMask (Optional)
ZCL_POWER_CONFIG_ATTR_MAINS_VOLT_MIN MainsVoltageMinThreshold (Optional)
ZCL_POWER_CONFIG_ATTR_MAINS_VOLT_MAX MainsVoltageMaxThreshold (Optional)
ZCL_POWER_CONFIG_ATTR_MAINS_VOLT_DWELL MainsVoltageDwellTripPoint (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_VOLTAGE BatteryVoltage (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_PCT BatteryPercentageRemaining (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_MFR_NAME BatteryManufacturer (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_SIZE BatterySize (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_AHRRATING BatteryAHrRating (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_QUANTITY BatteryQuantity (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_RATED_VOLT BatteryRatedVoltage (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_ALARM_MASK BatteryAlarmMask (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_VOLT_MIN BatteryVoltageMinThreshold (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_VTHRESHOLD1 BatteryVoltageThreshold1 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_VTHRESHOLD2 BatteryVoltageThreshold2 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_VTHRESHOLD3 BatteryVoltageThreshold3 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_PCT_MIN BatteryPercentageMinThreshold (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_PTHRESHOLD1 BatteryPercentageThreshold1 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_PTHRESHOLD2 BatteryPercentageThreshold2 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_PTHRESHOLD3 BatteryPercentageThreshold3 (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY_ALARM_STATE BatteryAlarmState (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_VOLTAGE BatteryVoltage - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_PCT BatteryPercentageRemaining - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_MFR_NAME BatteryManufacturer - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_SIZE BatterySize - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_AHRRATING BatteryAHrRating - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_QUANTITY BatteryQuantity - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_RATED_VOLT BatteryRatedVoltage - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_ALARM_MASK BatteryAlarmMask - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_VOLT_MIN BatteryVoltageMinThreshold - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_VTHRESHOLD1 BatteryVoltageThreshold1 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_VTHRESHOLD2 BatteryVoltageThreshold2 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_VTHRESHOLD3 BatteryVoltageThreshold3 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_PCT_MIN BatteryPercentageMinThreshold - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_PTHRESHOLD1 BatteryPercentageThreshold1 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_PTHRESHOLD2 BatteryPercentageThreshold2 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_PTHRESHOLD3 BatteryPercentageThreshold3 - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY2_ALARM_STATE BatteryAlarmState - Second battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_VOLTAGE BatteryVoltage - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_PCT BatteryPercentageRemaining - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_MFR_NAME BatteryManufacturer - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_SIZE BatterySize - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_AHRRATING BatteryAHrRating - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_QUANTITY BatteryQuantity - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_RATED_VOLT BatteryRatedVoltage - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_ALARM_MASK BatteryAlarmMask - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_VOLT_MIN BatteryVoltageMinThreshold - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_VTHRESHOLD1 BatteryVoltageThreshold1 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_VTHRESHOLD2 BatteryVoltageThreshold2 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_VTHRESHOLD3 BatteryVoltageThreshold3 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_PCT_MIN BatteryPercentageMinThreshold - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_PTHRESHOLD1 BatteryPercentageThreshold1 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_PTHRESHOLD2 BatteryPercentageThreshold2 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_PTHRESHOLD3 BatteryPercentageThreshold3 - Third Battery (Optional)
ZCL_POWER_CONFIG_ATTR_BATTERY3_ALARM_STATE BatteryAlarmState - Third Battery (Optional)

13. Power Profile

#include "zcl/general/zcl.power.profile.h"

Functions

ZbZclPowerProfClientAlloc

struct ZbZclClusterT * ZbZclPowerProfClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPowerProfClientCallbacks *callbacks, void *arg);

Create a new instance of the Power Profile Client cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPowerProfClientPhasesNotify

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

Send an Energy Phases Schedule Notification command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
notify Energy Phases Schedule Notification command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientPhasesResponse

enum ZclStatusCodeT ZbZclPowerProfClientPhasesResponse(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfCliPhasesNotify *notify, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a EnergyPhasesScheduleResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp EnergyPhasesScheduleResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientPhasesSchedStateReq

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

Send a EnergyPhasesScheduleStateRequest command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req EnergyPhasesScheduleStateRequest command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientPriceExtRsp

enum ZclStatusCodeT ZbZclPowerProfClientPriceExtRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfCliPriceRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a GetPowerProfilePriceExtendedResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp GetPowerProfilePriceExtendedResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientPriceRsp

enum ZclStatusCodeT ZbZclPowerProfClientPriceRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfCliPriceRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a GetPowerProfilePriceResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp GetPowerProfilePriceResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientProfileReq

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

Send a PowerProfileRequest command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req PowerProfileRequest command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientSchedConsReq

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

Send a PowerProfileScheduleConstraintsRequest command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req PowerProfileScheduleConstraintsRequest command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientSchedPriceRsp

enum ZclStatusCodeT ZbZclPowerProfClientSchedPriceRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfCliSchedPriceRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a GetOverallSchedulePriceResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp GetOverallSchedulePriceResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfClientStateReq

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

Send a PowerProfileStateRequest command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerAlloc

struct ZbZclClusterT * ZbZclPowerProfServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct ZbZclPowerProfServerCallbacks *callbacks, void *arg);

Create a new instance of the Power Profile Server cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPowerProfServerConstraintsNotify

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

Send a PowerProfileScheduleConstraintsNotification Command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
notify PowerProfileScheduleConstraintsNotification command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerConstraintsRsp

enum ZclStatusCodeT ZbZclPowerProfServerConstraintsRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfSvrConstraintsNotify *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a PowerProfileScheduleConstraintsResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp PowerProfileScheduleConstraintsResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerGetPriceReq

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

Send a GetPowerProfilePrice command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req GetPowerProfilePrice command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerGetPriceReqExtReq

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

Send a GetPowerProfilePriceExtended command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req GetPowerProfilePriceExtended command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerGetSchedPriceReq

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

Send a GetOverallSchedulePrice command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req GetOverallSchedulePrice command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerPhasesNotify

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

Send a EnergyPhasesScheduleStateNotification Command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
notify EnergyPhasesScheduleStateNotification command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerPhasesReq

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

Send a EnergyPhasesScheduleRequest command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req EnergyPhasesScheduleRequest command request structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerPhasesRsp

enum ZclStatusCodeT ZbZclPowerProfServerPhasesRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfSvrPhasesRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a EnergyPhasesScheduleStateResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp EnergyPhasesScheduleStateResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerProfileNotify

enum ZclStatusCodeT ZbZclPowerProfServerProfileNotify(struct ZbZclClusterT *cluster, const struct ZbApsAddrT *dst,
struct ZbZclPowerProfSvrProfileRsp *notify, void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a PowerProfileNotification Command. It is sent as a ZCL request with a unique sequence number, and can receive a Default Response if applicable

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
notify PowerProfileNotification command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerProfileRsp

enum ZclStatusCodeT ZbZclPowerProfServerProfileRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfSvrProfileRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a PowerProfileResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp PowerProfileResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerStateNotify

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

Send a PowerProfileStateNotification Command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
notify PowerProfileStateNotification command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclPowerProfServerStateRsp

enum ZclStatusCodeT ZbZclPowerProfServerStateRsp(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *dst,
struct ZbZclPowerProfSvrStateRsp *rsp, void (*callback)(struct ZbApsdeDataConfT *conf, void *arg), void *arg);

Send a PowerProfileStateResponse command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for response, including sequence number and tx options
rsp PowerProfileStateResponse command response structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclPowerProfileSvrAttrT

Power Profile Server Attribute IDs

ZCL_POWER_PROF_SVR_ATTR_TOTAL_PROFILENUM TotalProfileNum
ZCL_POWER_PROF_SVR_ATTR_MULTIPLE_SCHED MultipleScheduling
ZCL_POWER_PROF_SVR_ATTR_ENERGY_FORMAT EnergyFormatting
ZCL_POWER_PROF_SVR_ATTR_ENERGY_REMOTE EnergyRemote
ZCL_POWER_PROF_SVR_ATTR_SCHEDULE_MODE ScheduleMode

Structures

ZbZclPowerProfCliPhasesNotify

Energy Phases Schedule Notification command structure

Parameters

uint8_t profile_id Power ProfileID
uint8_t num_phases Num of Scheduled Phases
struct ZbZclPowerProfSchedPhase

sched_list

Schedule List

ZbZclPowerProfCliPriceRsp

GetPowerProfilePriceResponse command structure

Parameters

uint8_t profile_id Power Profile ID
uint16_t currency Currency
uint32_t price Price
uint8_t trailing_digit Price Trailing Digit

ZbZclPowerProfCliProfileReq

PowerProfileRequest command structure

Parameters

uint8_t profile_id PowerProfileID

ZbZclPowerProfCliSchedPriceRsp

GetOverallSchedulePriceResponse command structure

Parameters

uint16_t currency Currency
uint32_t price Price
uint8_t trailing_digit Price Trailing Digit

ZbZclPowerProfClientCallbacks

Power Profile Client callbacks configuration

Parameters

profile_notify

(callback function pointer)

enum ZclStatusCodeT (*profile_notify)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfSvrProfileRsp *notify, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileNotification command

get_price

(callback function pointer)

enum ZclStatusCodeT (*get_price)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliProfileReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of GetPowerProfilePrice command

state_notify

(callback function pointer)

enum ZclStatusCodeT (*state_notify)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfSvrStateRsp *notify, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileStateNotification command

get_sched_price

(callback function pointer)

enum ZclStatusCodeT (*get_sched_price)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of GetOverallSchedulePrice command

phases_req

(callback function pointer)

enum ZclStatusCodeT (*phases_req)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliProfileReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of EnergyPhasesScheduleRequest command

phases_notify

(callback function pointer)

enum ZclStatusCodeT (*phases_notify)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfSvrPhasesRsp *notify, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of EnergyPhasesScheduleStateNotification command

constraints_notify

(callback function pointer)

enum ZclStatusCodeT (*constraints_notify)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfSvrConstraintsNotify *notify, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileScheduleConstraintsNotification command

get_price_ext

(callback function pointer)

enum ZclStatusCodeT (*get_price_ext)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfSvrGetPriceExtReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of GetPowerProfilePriceExtended command

ZbZclPowerProfPhase

Phase structure

Parameters

uint8_t energy_phase_id Energy PhaseID
uint8_t macro_phase_id Macro PhaseID
uint16_t expect_duration ExpectedDuration
uint16_t peak_power Peak Power
uint16_t energy Energy
uint16_t max_activation_delay MaxActivationDelay

ZbZclPowerProfSchedPhase

Schedule Phase structure

Parameters

uint8_t energy_phase_id Energy PhaseID
uint16_t sched_time Scheduled Time

ZbZclPowerProfServerCallbacks

Power Profile Server callbacks configuration

Parameters

profile_req

(callback function pointer)

enum ZclStatusCodeT (*profile_req)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliProfileReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileRequest command

state_req

(callback function pointer)

enum ZclStatusCodeT (*state_req)(struct ZbZclClusterT *cluster, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileStateRequest command

phases_notify

(callback function pointer)

enum ZclStatusCodeT (*phases_notify)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliPhasesNotify *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of Energy Phases Schedule Notification command

sched_contraints_req

(callback function pointer)

enum ZclStatusCodeT (*sched_contraints_req)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliProfileReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of PowerProfileScheduleConstraintsRequest command

phases_sched_state_req

(callback function pointer)

enum ZclStatusCodeT (*phases_sched_state_req)(struct ZbZclClusterT *cluster, struct ZbZclPowerProfCliProfileReq *req, struct ZbZclAddrInfoT *srcInfo, void *arg)

Callback to application, invoked on receipt of EnergyPhasesScheduleStateRequest command

ZbZclPowerProfSvrConstraintsNotify

PowerProfileScheduleConstraintsNotification command structure

Parameters

uint8_t profile_id PowerProfileID
uint16_t start_after Start After
uint16_t stop_before Stop Before

ZbZclPowerProfSvrGetPriceExtReq

GetPowerProfilePriceExtended command structure

Parameters

uint8_t options Options - e.g. ZCL_PWR_PROF_PRICE_EXT_OPT_START_TIME_PRESENT
uint8_t profile_id PowerProfileID
uint16_t start_time PowerProfileStartTime - optional (ZCL_PWR_PROF_PRICE_EXT_OPT_START_TIME_PRESENT)

ZbZclPowerProfSvrPhasesRsp

Energy Phases Schedule Notification and EnergyPhasesScheduleResponse command structure

Parameters

uint8_t profile_id Power ProfileID
uint8_t num_sched_energy_phases Num of Scheduled Phases

ZbZclPowerProfSvrProfileRsp

PowerProfileNotification and PowerProfileResponse command structure

Parameters

uint8_t total_profile_num Total Profile Num
uint8_t profile_id Power ProfileID
uint8_t num_transferred_phases Num of Transferred Phases
struct ZbZclPowerProfPhase phase_list Phase List

ZbZclPowerProfSvrStateRsp

PowerProfileStateResponse command structure

Parameters

uint8_t profile_count Power Profile Count
struct ZbZclPowerProfileRecord record_list Record List

ZbZclPowerProfileRecord

Record structure

Parameters

uint8_t profile_id Power Profile ID
uint8_t energy_phase_id Energy Phase ID
uint8_t remote_control PowerProfileRemoteControl
enum ZbZclPowerProfState state PowerProfile State

14. Pressure Measurement

#include "zcl/general/zcl.press.meas.h"

Functions

ZbZclPressMeasClientAlloc

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

Create a new instance of the Pressure Measurement Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPressMeasServerAlloc

struct ZbZclClusterT * ZbZclPressMeasServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, int16_t min, int16_t max);

Create a new instance of the Pressure Measurement Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
min Default minimum measured value written to ZCL_PRESS_MEAS_ATTR_MIN_MEAS_VAL attribute during allocation
max Default maximum measured value written to ZCL_PRESS_MEAS_ATTR_MAX_MEAS_VAL attribute during allocation

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclPressMeasSvrAttrT

Pressure Measurement Attribute IDs

ZCL_PRESS_MEAS_ATTR_MEAS_VAL MeasuredValue
ZCL_PRESS_MEAS_ATTR_MIN_MEAS_VAL MinMeasuredValue
ZCL_PRESS_MEAS_ATTR_MAX_MEAS_VAL MaxMeasuredValue
ZCL_PRESS_MEAS_ATTR_TOLERANCE Tolerance (Optional)
ZCL_PRESS_MEAS_ATTR_SCALED_VAL ScaledValue (Optional)
ZCL_PRESS_MEAS_ATTR_MIN_SCALED_VAL MinScaledValue (Optional)
ZCL_PRESS_MEAS_ATTR_MAX_SCALED_VAL MaxScaledValue (Optional)
ZCL_PRESS_MEAS_ATTR_SCALED_TOL ScaledTolerance (Optional)
ZCL_PRESS_MEAS_ATTR_SCALE Scale (Optional)

15. Pump Configuration and Control

#include "zcl/general/zcl.pump.h"

Functions

ZbZclPumpClientAlloc

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

Instantiate a new instance of the Pump Configuration and Control client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclPumpServerAlloc

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

Instantiate a new instance of the Pump Configuration and Control server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclPumpServerAttrT

Pump Configuration and Control Attribute Ids

ZCL_PUMP_SVR_ATTR_MAX_PRESSURE MaxPressure
ZCL_PUMP_SVR_ATTR_MAX_SPEED MaxSpeed
ZCL_PUMP_SVR_ATTR_MAX_FLOW MaxFlow
ZCL_PUMP_SVR_ATTR_MIN_CONST_PRESSURE MinConstPressure
ZCL_PUMP_SVR_ATTR_MAX_CONST_PRESSURE MaxConstPressure
ZCL_PUMP_SVR_ATTR_MIN_COMP_PRESSURE MinCompPressure
ZCL_PUMP_SVR_ATTR_MAX_COMP_PRESSURE MaxCompPressure
ZCL_PUMP_SVR_ATTR_MIN_CONST_SPEED MinConstSpeed
ZCL_PUMP_SVR_ATTR_MAX_CONST_SPEED MaxConstSpeed
ZCL_PUMP_SVR_ATTR_MIN_CONST_FLOW MinConstFlow
ZCL_PUMP_SVR_ATTR_MAX_CONST_FLOW MaxConstFlow
ZCL_PUMP_SVR_ATTR_MIN_CONST_TEMP MinConstTemp
ZCL_PUMP_SVR_ATTR_MAX_CONST_TEMP MaxConstTemp
ZCL_PUMP_SVR_ATTR_PUMP_STATUS PumpStatus
ZCL_PUMP_SVR_ATTR_EFF_OP_MODE EffectiveOperationMode
ZCL_PUMP_SVR_ATTR_EFF_CTRL_MODE EffectiveControlMode
ZCL_PUMP_SVR_ATTR_CAPACITY Capacity
ZCL_PUMP_SVR_ATTR_SPEED Speed
ZCL_PUMP_SVR_ATTR_RUNNING_HOURS LifetimeRunningHours
ZCL_PUMP_SVR_ATTR_POWER Power
ZCL_PUMP_SVR_ATTR_ENERGY_CONSUMED LifetimeEnergyConsumed
ZCL_PUMP_SVR_ATTR_OP_MODE OperationMode
ZCL_PUMP_SVR_ATTR_CTRL_MODE ControlMode
ZCL_PUMP_SVR_ATTR_ALARM_MASK AlarmMask

16. RSSI Location

#include "zcl/general/zcl.rssi.loc.h"

Functions

ZbZclRssiLocClientAlloc

struct ZbZclClusterT * ZbZclRssiLocClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct zcl_rssi_loc_client_callbacks_t *callbacks, void *arg);

Create a new instance of the RSSI Location Client cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclRssiLocClientAnchorNodeAnnc

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

Send a Anchor Node Announce command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
anchor_node_annc Anchor Node Announce command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientGetDevConfig

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

Send a Get Device Configuration command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
get_dev_config Get Device Configuration command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientGetLocData

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

Send a Get Location Data command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
get_loc_data Get Location Data command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientSendPings

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

Send a Send Pings command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
send_pings Send Pings command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientSendRssiRsp

enum ZclStatusCodeT ZbZclRssiLocClientSendRssiRsp(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dst_info, struct rssi_loc_rssi_rsp *rsp);

Send a RSSI Response command

Parameters

clusterPtr Cluster instance from which to send this command
dst_info Destination address for request
rsp Rssi Response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientSetAbsLocation

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

Send a Set Absolute Location command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
set_abs_loc Set Absolute Location command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocClientSetDevConfig

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

Send a Set Device Configuration command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
set_dev_config Set Device Config command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerAlloc

struct ZbZclClusterT * ZbZclRssiLocServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, struct zcl_rssi_loc_server_callbacks_t *callbacks, void *arg);

Create a new instance of the RSSI Location Server cluster

Parameters

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 will included in the callback when invoked.

Return

  • Cluster pointer, or NULL if there is an error

ZbZclRssiLocServerCompDataNotif

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

Send a Compact Data Notification command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerLocDataNotif

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

Send a Location Data Notification command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerReportRssi

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

Send a Report RSSI command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
report_rssi Report Rssi command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerReqOwnLoc

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

Send a Request Own Location command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
req_own_loc Request Own Location command structure
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerRssiPing

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

Send a RSSI Ping command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerRssiReq

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

Send a RSSI Request command

Parameters

cluster Cluster instance from which to send this command
dst Destination address for request
callback Callback function that will be invoked when the response is received.
arg Pointer to application data that will included in the callback when invoked.

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerSendDevConfigRsp

enum ZclStatusCodeT ZbZclRssiLocServerSendDevConfigRsp(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dst_info,
struct rssi_loc_dev_config_rsp *rsp);

Send a Device Configuration Response command

Parameters

clusterPtr Cluster instance from which to send this command
dst_info Destination address for request
rsp Send Device Configuration response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

ZbZclRssiLocServerSendLocDataRsp

enum ZclStatusCodeT ZbZclRssiLocServerSendLocDataRsp(struct ZbZclClusterT *clusterPtr, struct ZbZclAddrInfoT *dst_info,
struct rssi_loc_loc_data_rsp *rsp);

Send a Location Data Response command

Parameters

clusterPtr Cluster instance from which to send this command
dst_info Destination address for request
rsp Send Location Data response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclRssiLocSvrAttrT

Rssi Location Attribute IDs

ZCL_RSSI_LOC_SVR_ATTR_LOCATION_TYPE LocationType
ZCL_RSSI_LOC_SVR_ATTR_LOCATION_METHOD LocationMethod
ZCL_RSSI_LOC_SVR_ATTR_LOCATION_AGE LocationAge (Optional)
ZCL_RSSI_LOC_SVR_ATTR_QUALITY_MEAS QualityMeasure (Optional)
ZCL_RSSI_LOC_SVR_ATTR_NUM_DEVICES NumberOfDevices (Optional)
ZCL_RSSI_LOC_SVR_ATTR_COORD1 Coordinate1
ZCL_RSSI_LOC_SVR_ATTR_COORD2 Coordinate2
ZCL_RSSI_LOC_SVR_ATTR_COORD3 Coordinate3 (Optional)
ZCL_RSSI_LOC_SVR_ATTR_POWER Power
ZCL_RSSI_LOC_SVR_ATTR_PATH_LOSS_EXP PathLossExponent
ZCL_RSSI_LOC_SVR_ATTR_REPORT_PERIOD ReportingPeriod (Optional)
ZCL_RSSI_LOC_SVR_ATTR_CALC_PERIOD CalculationPeriod (Optional)
ZCL_RSSI_LOC_SVR_ATTR_NUM_RSSI_MEAS NumberRSSIMeasurements

Structures

rssi_loc_anchor_node_annc

Anchor Node Announce command structure

Parameters

uint64_t addr Anchor Node IEEE Address
int16_t x X
int16_t y Y
int16_t z Z

rssi_loc_comp_data_notif

Compact Data Notification command structure

Parameters

uint8_t loc_type Location Type
int16_t coord1 Coordinate 1
int16_t coord2 Coordinate 2
int16_t coord3 Coordinate 3
uint8_t quality_meas Quality Measure
uint16_t loc_age Location Age

rssi_loc_dev_config_rsp

Device Configuration response structure

Parameters

enum ZclStatusCodeT status Status
int16_t power Power
uint16_t path_loss_exp Path Loss Exponent
uint16_t calc_period Calculation Period
uint8_t num_rssi_meas Number RSSI Measurements
uint16_t report_period Reporting Period

rssi_loc_get_dev_config

Get Device Configuration command structure

Parameters

uint64_t target_addr Target Address

rssi_loc_get_loc_data

Get Location Data command structure

Parameters

uint8_t bitmap Bitmap
uint8_t num_responses Number Responses
uint64_t target_addr Target Address

rssi_loc_loc_data_notif

Location Data Notification command structure

Parameters

uint8_t loc_type Location Type
int16_t coord1 Coordinate 1
int16_t coord2 Coordinate 2
int16_t coord3 Coordinate 3
int16_t power Power
uint16_t path_loss_exp Path Loss Exponent
uint8_t loc_method Location Method
uint8_t quality_meas Quality Measure
uint16_t loc_age Location Age

rssi_loc_loc_data_rsp

Location Data response structure

Parameters

enum ZclStatusCodeT status Status
uint8_t loc_type Location Type
int16_t coord1 Coordinate 1
int16_t coord2 Coordinate 2
int16_t coord3 Coordinate 3
int16_t power Power
uint16_t path_loss_exp Path Loss Exponent
uint8_t loc_method Location Method
uint8_t quality_meas Quality Measure
uint16_t loc_age Location Age

rssi_loc_neighbour_info

Neighbour Info structure

Parameters

uint64_t neighbour Neighbour
int16_t x X
int16_t y Y
int16_t z Z
int8_t rssi RSSI
uint8_t num_rssi_meas NumberRSSIMeasurements

rssi_loc_report_rssi

Report Rssi command structure

Parameters

uint64_t measuring_dev Measuring Device
uint8_t n_neighbours N Neighbours
struct rssi_loc_neighbour_info neighbours_info NeighboursInfo

rssi_loc_req_own_loc

Request Own Location command structure

Parameters

uint64_t addr IEEE Address of the Blind Node

rssi_loc_rssi_ping

Rssi Ping command structure

Parameters

uint8_t loc_type Location Type

rssi_loc_rssi_req

Rssi Request structure

Parameters

uint8_t rssi Rssi

rssi_loc_rssi_rsp

Rssi response structure

Parameters

uint64_t replying_dev Replying Device
int16_t x X
int16_t y Y
int16_t z Z
int8_t rssi RSSI
uint8_t num_rssi_meas NumberRSSIMeasurements

rssi_loc_send_pings

Send Pings command structure

Parameters

uint64_t target_addr Target Address
uint8_t num_rssi_meas NumberRSSIMeasurements
uint16_t calc_period CalculationPeriod

rssi_loc_set_abs_loc

Set Absolute Location command structure

Parameters

int16_t coord1 Coordinate 1
int16_t coord2 Coordinate 2
int16_t coord3 Coordinate 3
int16_t power Power
uint16_t path_loss_exp Path Loss Exponent

rssi_loc_set_dev_config

Set Device Configuration command structure

Parameters

int16_t power Power
uint16_t path_loss_exp Path Loss Exponent
uint16_t calc_period Calculation Period
uint8_t num_rssi_meas Number Rssi Measurements
uint16_t report_period Reporting Period

zcl_rssi_loc_client_callbacks_t

Rssi Location Client callbacks configuration

Parameters

loc_data_notif

(callback function pointer)

enum ZclStatusCodeT (*loc_data_notif)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_loc_data_notif *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Location Data Notification command

comp_data_notif

(callback function pointer)

enum ZclStatusCodeT (*comp_data_notif)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_comp_data_notif *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Compact Data Notification command

rssi_ping

(callback function pointer)

enum ZclStatusCodeT (*rssi_ping)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_rssi_ping *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of RSSI Ping command

rssi_req

(callback function pointer)

enum ZclStatusCodeT (*rssi_req)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_rssi_req *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of RSSI request.

report_rssi

(callback function pointer)

enum ZclStatusCodeT (*report_rssi)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_report_rssi *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Report Rssi command

req_own_loc

(callback function pointer)

enum ZclStatusCodeT (*req_own_loc)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_req_own_loc *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Request Own Location command

zcl_rssi_loc_server_callbacks_t

Rssi Location Server callbacks configuration

Parameters

get_dev_config

(callback function pointer)

enum ZclStatusCodeT (*get_dev_config)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_get_dev_config *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Get Device Configuration command

get_loc_data

(callback function pointer)

enum ZclStatusCodeT (*get_loc_data)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_get_loc_data *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Get Location Data command

send_pings

(callback function pointer)

enum ZclStatusCodeT (*send_pings)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_send_pings *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Send Pings command

anchor_node_annc

(callback function pointer)

enum ZclStatusCodeT (*anchor_node_annc)(struct ZbZclClusterT *clusterPtr, struct rssi_loc_anchor_node_annc *cmd_req, struct ZbZclAddrInfoT *src_info, void *arg)

Callback to application, invoked on receipt of Anchor Node Announce command

17. Scenes

#include "zcl/general/zcl.scenes.h"

Description

ZCL 8 section 3.7

A scene is a set of values for attributes from multiple clusters capable of being applied at the same time. The few clusters that support scenes are identified by a section with the title "Scene Table Extensions" in the ZCL 8 Specification (ZCL8) section for those cluster. There is only one scene table (list of attributes) for a cluster that supports scenes, and when a scene is invoked all scene table attributes are set to the values given in the scene table.

To use the scene table for a cluster, the cluster must reside on an endpoint which also hosts an instance of the Scenes cluster. There may be multiple scene table supporting clusters on a given endpoint. A scene is defined in the scenes cluster and contains scene tables for one or more clusters. Through the use of group addressing a scene may be applied to multiple endpoints on a node.

A scene may be created by the scene cluster using the Add Scene command, where the application manually defines the scene table for each cluster included in that scene. All attributes must have values in the scene table, but inclusion of individual clusters is optional. A scene may also be created using the Store Scene command where the current value of all the attributes in the cluster at the time the Store Scene command is issued are recorded in the scene table for later use.

The Scenes cluster Recall Scene command takes the scene table for each cluster in that scene and sets the values of every scene table attribute.

For example, a node could contain three endpoints:

  • 0x01 with the OnOff and Window Covering clusters
  • 0x02 with the OnOff and Door Lock clusters
  • 0x03 with the OnOff and Level.

A scene is defined with a scene tables for the:

  • OnOff cluster: OnOff = On
  • Level cluster: CurrentLevel = 50%
  • DoorLock cluster: LockState = Locked

Additionally:

  • Endpoints 0x01 and 0x02 are in group 0x0001
  • Endpoint 0x03 is not in group 0x0001

If the scenes cluster Recall Scenes command is issued with group address 0x0001 and the scene defined above, then on endpoint

0x01 and 0x02 the OnOff cluster OnOff attribute will be set on and the DoorLock on endpoint 0x02 will be locked.

The Window Covering cluster on endpoint 0x01 will not be affected because this scene does not include a scene table for this cluster and all of endpoint 0x03 will be unaffected because it is not in group 0x0001.

For more information about the Scenes cluster, see Section 3.7 in ZCL8.

Functions

ZbZclScenesClientAlloc

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

Create a new instance of the Scenes Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclScenesServerAlloc

struct ZbZclClusterT * ZbZclScenesServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint8_t maxScenes);

Create a new instance of the Scenes Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
maxScenes Maximum number of scenes supported by this cluster

Return

  • Cluster pointer, or NULL if there is an error

zcl_scenes_client_add_req

enum ZclStatusCodeT zcl_scenes_client_add_req(struct ZbZclClusterT *cluster, struct zcl_scenes_add_request_t *add_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send an Add Scene or Enhanced Add Scene command, depending on isEnhanced flag in Add Scene command structure

Parameters

cluster Cluster instance from which to send this command
add_req Add Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_add_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_add_rsp_parse(struct zcl_scenes_add_response_t *add_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse an Add Scene Response command payload into a structure

Parameters

add_rsp Add Scene Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_copy_req

enum ZclStatusCodeT zcl_scenes_client_copy_req(struct ZbZclClusterT *cluster, struct zcl_scenes_copy_request_t *copy_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Copy Scene command

Parameters

cluster Cluster instance from which to send this command
copy_req Copy Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_copy_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_copy_rsp_parse(struct zcl_scenes_copy_response_t *copy_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Copy Scene Response command payload into a structure

Parameters

copy_rsp Copy Scene response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_get_membership_req

enum ZclStatusCodeT zcl_scenes_client_get_membership_req(struct ZbZclClusterT *cluster, struct zcl_scenes_membership_request_t *get_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Get Scene Membership command

Parameters

cluster Cluster instance from which to send this command
get_req Get Scene Membership command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_get_membership_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_get_membership_rsp_parse(struct zcl_scenes_membership_response_t *get_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Get Scene Membership Response command payload into a structure

Parameters

get_rsp Get Scene Membership Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_recall_req

enum ZclStatusCodeT zcl_scenes_client_recall_req(struct ZbZclClusterT *cluster, struct zcl_scenes_recall_request_t *recall_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Recall Scene command

Parameters

cluster Cluster instance from which to send this command
recall_req Recall Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_recall_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_recall_rsp_parse(struct zcl_scenes_recall_response_t *recall_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Recall Scene Response command payload into a structure

Parameters

recall_rsp Recall Scene response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_remove_all_req

enum ZclStatusCodeT zcl_scenes_client_remove_all_req(struct ZbZclClusterT *cluster, struct zcl_scenes_remove_all_request_t *remove_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Remove All Scenes command

Parameters

cluster Cluster instance from which to send this command
remove_req Remove All Scenes command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_remove_all_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_remove_all_rsp_parse(struct zcl_scenes_remove_all_response_t *remove_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Remove All Scenes Response command payload into a structure

Parameters

remove_rsp Remove All Scenes Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_remove_req

enum ZclStatusCodeT zcl_scenes_client_remove_req(struct ZbZclClusterT *cluster, struct zcl_scenes_remove_request_t *remove_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Remove Scene command

Parameters

cluster Cluster instance from which to send this command
remove_req Remove Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_remove_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_remove_rsp_parse(struct zcl_scenes_remove_response_t *remove_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Remove Scene Response command payload into a structure

Parameters

remove_rsp Remove Scene Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_store_req

enum ZclStatusCodeT zcl_scenes_client_store_req(struct ZbZclClusterT *cluster, struct zcl_scenes_store_request_t *store_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send a Store Scene command

Parameters

cluster Cluster instance from which to send this command
store_req Store Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_store_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_store_rsp_parse(struct zcl_scenes_store_response_t *store_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a Store Scene Response command payload into a structure

Parameters

store_rsp Store Scene Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_view_req

enum ZclStatusCodeT zcl_scenes_client_view_req(struct ZbZclClusterT *cluster, struct zcl_scenes_view_request_t *view_req,
void (*callback)(struct ZbZclCommandRspT *zcl_rsp, void *arg), void *arg);

Send an View Scene or Enhanced View Scene command, depending on isEnhanced flag in View Scene command structure

Parameters

cluster Cluster instance from which to send this command
view_req View Scene command structure
callback Callback function that will be called when the response for this request is received
arg Pointer to application data provided in initiating API call

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

zcl_scenes_client_view_rsp_parse

enum ZclStatusCodeT zcl_scenes_client_view_rsp_parse(struct zcl_scenes_view_response_t *view_rsp, struct ZbZclCommandRspT *zcl_rsp);

Parse a View Scene Response command payload into a structure

Parameters

view_rsp View Scene Response command structure
zcl_rsp Cluster response structure

Return

  • ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error

Enumerations

ZbZclScenesAttrT

Scenes Attribute IDs

ZCL_SCENES_ATTR_SCENE_COUNT SceneCount
ZCL_SCENES_ATTR_CURRENT_SCENE CurrentScene
ZCL_SCENES_ATTR_CURRENT_GROUP CurrentGroup
ZCL_SCENES_ATTR_SCENE_VALID SceneValid
ZCL_SCENES_ATTR_NAME_SUPPORT NameSupport
ZCL_SCENES_ATTR_LAST_CONFIGURED_BY LastConfiguredBy (Optional)

Structures

zcl_scenes_add_request_t

Add Scene command structure

Parameters

bool isEnhanced If true, send an Enhanced Add Scene request
struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID
uint8_t sceneId Scene ID
uint16_t transition Transition time
const char *sceneName Scene Name (string length must be <= ZCL_SCENES_NAME_MAX_LENGTH)
const char *extStrPtr Extension field sets as an ASCII hex string in the format as sent in the command payload. As per the ZCL Spec, each set has the format: {clusterId, length, {extension field set}} E.g. For the OnOff cluster: "06000101"

zcl_scenes_add_response_t

Add Scene Response command structure

Parameters

uint8_t status Status
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_copy_request_t

Copy Scene command structure

Parameters

struct ZbApsAddrT dst Destination address for request
bool allScenes Copy All Scenes - sets bit within Mode parameter to enable Copy All Scenes
uint16_t groupFrom Group identifier from
uint8_t sceneFrom Scene identifier from - only used if allScenes is FALSE
uint16_t groupTo Group identifier to
uint8_t sceneTo Scene identifier to - only used if allScenes is FALSE

zcl_scenes_copy_response_t

Copy Scene Response command structure

Parameters

uint8_t status Status
uint16_t groupFrom Group identifier from
uint8_t sceneFrom Scene identifier from

zcl_scenes_membership_request_t

Get Scene Membership command structure

Parameters

struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID

zcl_scenes_membership_response_t

Get Scene Membership Response command structure

Parameters

uint8_t status Status
uint8_t capacity Capacity
uint16_t groupId Group ID
uint8_t sceneCount Scent count
uint8_t sceneList Scene list

zcl_scenes_recall_request_t

Recall Scene command structure

Parameters

struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID
uint8_t sceneId Scene ID
uint16_t transition Transition time - time in 1/10ths of second. ZCL_SCENES_RECALL_TRANSITION_INVALID (0xffff) means invalid, and won’t be included. (Optional)

zcl_scenes_recall_response_t

Recall Scene Response command structure

Parameters

uint8_t status Status

zcl_scenes_remove_all_request_t

Remove All Scenes command structure

Parameters

struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID

zcl_scenes_remove_all_response_t

Remove All Scenes Response command structure

Parameters

uint8_t status Status
uint16_t groupId Group ID

zcl_scenes_remove_request_t

Remove Scene command structure

Parameters

struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_remove_response_t

Remove Scene Response command structure

Parameters

uint8_t status Status
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_store_request_t

Store Scene command structure

Parameters

struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_store_response_t

Store Scene Response command structure

Parameters

uint8_t status Status
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_view_request_t

View Scene command structure

Parameters

bool isEnhanced If true, send an Enhanced View Scene request
struct ZbApsAddrT dst Destination address for request
uint16_t groupId Group ID
uint8_t sceneId Scene ID

zcl_scenes_view_response_t

View Scene Response command structure

Parameters

uint8_t status Status
uint16_t groupId Group ID
uint8_t sceneId Scene ID
uint16_t transition Transition time
char nameStr Scene Name
uint8_t extNum Number of Extension field sets
struct { uint16_t clusterId Cluster ID
uint8_t length Length
uint8_t field Field - ZCL_SCENES_VIEW_EXT_FIELD_MAX_LEN

18. Temperature Measurement

#include "zcl/general/zcl.temp.meas.h"

Functions

ZbZclTempMeasClientAlloc

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

Create a new instance of the Temperature Measurement Client cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster

Return

  • Cluster pointer, or NULL if there is an error

ZbZclTempMeasServerAlloc

struct ZbZclClusterT * ZbZclTempMeasServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, int16_t min, int16_t max, uint16_t tolerance);

Create a new instance of the Temperature Measurement Server cluster

Parameters

zb Zigbee stack instance
endpoint Endpoint on which to create cluster
min Minimum value capable of being measured (MinMeasuredValue)
max Maximum value capable of being measured (MaxMeasuredValue)
tolerance Tolerance

Return

  • Cluster pointer, or NULL if there is an error

Enumerations

ZbZclTempMeasSvrAttrT

Temperature Measurement Server Attribute IDs

ZCL_TEMP_MEAS_ATTR_MEAS_VAL MeasuredValue
ZCL_TEMP_MEAS_ATTR_MIN_MEAS_VAL MinMeasuredValue
ZCL_TEMP_MEAS_ATTR_MAX_MEAS_VAL MaxMeasuredValue
ZCL_TEMP_MEAS_ATTR_TOLERANCE Tolerance (Optional)



Previous step Arrow left.png Arrow right.png Next step