• No results found

5.6 Commissioning cluster

5.6.2 Commissioning cluster functions

5.6.2.1 ZbZclCommissionClientAlloc

struct ZbZclClusterT * ZbZclCommissionClientAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint16_t profile, bool aps_secured);

Create a new instance of the Commissioning Client cluster

Table 68. ZbZclCommissionClientAlloc parameters

Parameter Description

zb Zigbee® stack instance

Parameter Description

endpoint Set to ZB_ENDPOINT_BCAST if using Inter-PAN for communicating ZCL messages. Otherwise, set a valid ZCL endpoint.

profile Profile ID for this cluster (e.g. ZCL_PROFILE_HOME_AUTOMATION) aps_secured APS security - true if APS security enabled, else false

Return: Cluster pointer, or NULL if there is an error.

5.6.2.2 ZbZclCommissionClientEnable

enum ZclStatusCodeT ZbZclCommissionClientEnable(struct ZbZclClusterT *cluster, struct ZbZclCommissionClientEnableInfoT *info);

Enable Commissioning Client by configuring MAC layer to listen for packets.

Table 69. ZbZclCommissionClientEnable parameters

Parameter Description

cluster Cluster instance from which to send this command info Commissioning Client Enable Information structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.3 ZbZclCommissionClientSendResetStartup

enum ZclStatusCodeT ZbZclCommissionClientSendResetStartup(struct ZbZclClusterT*cluster, uint64_t dst_ext, uint8_t dst_ep, struct ZbZclCommissionClientResetStartup *req, void (*callback)(struct ZbZclCommandRspT*rsp, void *arg), void *arg);

Send a Reset Startup Parameters command

Table 70. ZbZclCommissionClientSendResetStartup parameters

Parameter Description

cluster Cluster instance from which to send this command dst_ext Extended address of the device to send this command

dst_ep If cluster is not using Inter-PAN, this is the destination endpoint to send the command to.

req Reset Startup Parameters command structure

callback Callback function that is invoked when the response is received

arg Pointer to application data that is provided back to the callback function when invoked

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.4 ZbZclCommissionClientSendRestart

enum ZclStatusCodeT ZbZclCommissionClientSendRestart(struct ZbZclClusterT *cluster, uint64_t dst_ext, uint8_t dst_ep, struct ZbZclCommissionClientRestartDev *req, void (*callback)

(struct ZbZclCommandRspT *rsp, void *arg), void *arg);

Send a Restart Device command

Table 71. ZbZclCommissionClientSendRestart parameters

Parameter Description

cluster Cluster instance from which to send this command dst_ext Extended address of the device to send this command

dst_ep If cluster is not using Inter-PAN, this is the destination endpoint to send the command to.

req Restart Device command structure

callback Callback function that is invoked when the response is received

arg Pointer to application data that is provided back to the callback function when invoked

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.5 ZbZclCommissionClientSendRestoreStartup

enum ZclStatusCodeT ZbZclCommissionClientSendRestoreStartup(struct ZbZclClusterT*cluster, uint64_t dst_ext, uint8_t dst_ep, struct ZbZclCommissionClientRestoreStartup *req, void (*callback)(struct ZbZclCommandRspT*rsp, void *arg), void *arg);

Send a Restore Startup Parameters command

Table 72. ZbZclCommissionClientSendRestoreStartup parameters

Parameter Description

cluster Cluster instance from which to send this command dst_ext Extended address of the device to send this command

dst_ep If cluster is not using Inter-PAN, this is the destination endpoint to send the command to.

req Restore Startup Parameters command structure

callback Callback function that is invoked when the response is received

arg Pointer to application data that is provided back to the callback function when invoked

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.6 ZbZclCommissionServerAlloc

struct ZbZclClusterT * ZbZclCommissionServerAlloc(struct ZigBeeT *zb, uint8_t endpoint, uint16_t profile, bool aps_secured, struct ZbZclCommissionServerCallbacksT *callbacks, void

*arg);

Create a new instance of the Commissioning Server cluster

Table 73. ZbZclCommissionServerAlloc parameters

Parameter Description

zb Zigbee® stack instance

endpoint Set to ZB_ENDPOINT_BCAST if using Inter-PAN for communicating ZCL messages. Otherwise, set a valid ZCL endpoint.

profile Profile ID for this cluster (e.g. ZCL_PROFILE_HOME_AUTOMATION) aps_secured APS security - true if APS security enabled, else false

callback Structure containing any callback function pointers for this cluster

arg Pointer to application data that is provided back to the callback function when invoked

Return: Cluster pointer, or NULL if there is an error.

5.6.2.7 ZbZclCommissionServerEnable

enum ZclStatusCodeT ZbZclCommissionServerEnable(struct ZbZclClusterT *cluster, bool enable, struct ZbZclCommissionServerEnableInfoT *info);

Enable the Commissioning Server by configuring the MAC layer to listen for packets. If enable is false, then Commissioning Server stops processing any received Commissioning packets.

Table 74. ZbZclCommissionServerEnable parameters

Parameter Description

cluster Cluster instance from which to send this command

enable Enable or disable the ability to receive and process Commissioning commands

info

Commissioning Server Enable Information structure. Contains information needed to start listening for Commissioning commands on a given channel. Optional and only applicable if enable is true. This may be NULL if already configured and operational on a network.

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.8 ZbZclCommissionServerGetStartup

enum ZclStatusCodeT ZbZclCommissionServerGetStartup(struct ZbZclClusterT *cluster, struct ZbStartupT *config);

Load startup configuration from Cluster Server’s attributes to the stack’s ZbStartupT structure

Table 75. ZbZclCommissionServerGetStartup parameters

Parameter Description

cluster Cluster instance from which to send this command config Zigbee® Stack Startup Configuration structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.9 ZbZclCommissionServerResetStartup

enum ZclStatusCodeT ZbZclCommissionServerResetStartup(struct ZbZclClusterT*cluster);

Reset startup configurations cluster attributes back to defaults

Table 76. ZbZclCommissionServerResetStartup parameters

Parameter Description

cluster Cluster instance from which to send this command

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.10 ZbZclCommissionServerSendResetStartupRsp

enum ZclStatusCodeT ZbZclCommissionServerSendResetStartupRsp(struct ZbZclClusterT*cluster, struct ZbZclAddrInfoT *dst, struct ZbZclCommissionServerResetStartupRsp*rsp);

Send a Reset Startup Parameters Response command

Table 77. parameters

Parameter Description

cluster Cluster instance from which to send this command

dst Destination address for response, including sequence number and tx options rsp Reset Startup Parameters Response command structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.11 ZbZclCommissionServerSendRestartRsp

enum ZclStatusCodeT ZbZclCommissionServerSendRestartRsp(struct ZbZclClusterT*cluster, struct ZbZclAddrInfoT *dst, struct ZbZclCommissionServerRestartDevRsp*rsp);

Send a Restart Device Response command

Table 78. ZbZclCommissionServerSendRestartRsp parameters

Parameter Description

cluster Cluster instance from which to send this command

dst Destination address for response, including sequence number and tx options rsp Restart Device Response command structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.12 ZbZclCommissionServerSendRestoreStartupRsp

enum ZclStatusCodeT ZbZclCommissionServerSendRestoreStartupRsp(struct ZbZclClusterT*cluster, struct ZbZclAddrInfoT *dst, struct ZbZclCommissionServerRestoreStartupRsp*rsp);

Send a Restore Startup Parameters Response command

Table 79. ZbZclCommissionServerSendRestoreStartupRsp Parameters

Parameter Description

cluster Cluster instance from which to send this command

dst Destination address for response, including sequence number and tx options rsp Restore Startup Parameters Response command structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.2.13 ZbZclCommissionServerSendSaveStartupRsp

enum ZclStatusCodeT ZbZclCommissionServerSendSaveStartupRsp(struct ZbZclClusterT*cluster, struct ZbZclAddrInfoT *dst, struct ZbZclCommissionServerSaveStartupRsp*rsp);

Send a Save Startup Parameters Response command

Table 80. ZbZclCommissionServerSendSaveStartupRsp Parameters

Parameter Description

cluster Cluster instance from which to send this command

dst Destination address for response, including sequence number and tx options rsp Save Startup Parameters Response command structure

Return: ZCL_STATUS_SUCCESS if successful, or other ZclStatusCodeT value on error.

5.6.3 Commissioning cluster enumerations