Zigbee Service

Last Updated on : 2022-11-24 09:20:14download

This topic describes the Zigbee service APIs that are used to build devices communicating over a Zigbee network.

API list

Function name Description
iot_reg_gw_mgr_cb Sets Zigbee status callbacks.
zigbee_svc_init Initializes the Zigbee service.
zigbee_svc_start Starts the Zigbee service.
ziggbe_send_data Sends data over the Zigbee network.
ziggbe_del_dev Deletes a sub-device from a Zigbee network.
zigbee_set_tx_radio_power Sets the tx_radio for the Zigbee module.
zigbee_get_ncp_ver Gets the Zigbee version number.
devDelCallBack Sub-device deletion callback.
devBindCallBack Sub-device binding callback.
devHbCallBack Hb deletion callback.
devUpgardeCallBack Sub-device update callback.
devResetCallBack Sub-device reset callback.
z3Join Joining Zigbee network callback.
z3_leave Leaving Zigbee network callback.
z3_report Zigbee cluster library (ZCL) data reporting callback.
z3_notify Notification callback that gets invoked when the Zigbee module finishes starting up.
z3_upgrade_end Notification callback that gets invoked when a firmware update is finished.

API description

iot_reg_gw_mgr_cb

Function prototype

iot_reg_gw_mgr_cb

fun iot_reg_gw_mgr_cb(dep_tp: Int, devMgrLsitener: ZigbeeListener.DevMgrListener): Int

Functional description

Sets Zigbee status callbacks.

Parameter description

Parameter name Description
dep_tp dp Tp
devMgrLsitener Zigbee callback

Return value

Return value Description
0 Success
Other values Failure

zigbee_svc_init

Function prototype

fun zigbee_svc_init(zigbeeModel: ZigbeeModel): Int

Functional description

Initializes the Zigbee service.

Parameter description

Parameter name Description
zigbeeModel Zigbee information model

Return value

Return value Description
0 Success
Other values Failure

zigbee_svc_start

Function prototype

fun zigbee_svc_start(zigbeeModel: ZigbeeModel): Int

Functional description

Starts the Zigbee service.

Parameter description

Parameter name Description
zigbeeModel Zigbee information model

Return value

Return value Description
0 Success
Other values Failure

ziggbe_send_data

Function prototype

fun ziggbe_send_data(zigbeeZ3ApsFrameMode: ZigbeeZ3ApsFrameMode): Int

Functional description

Sends data over the Zigbee network.

Parameter description

Parameter name Description
zigbeeZ3ApsFrameMode ApsFrameMode information model

Return value

Return value Description
0 Success
Other values Failure

ziggbe_del_dev

Function prototype

external fun ziggbe_del_dev(dip: String): Int

Functional description

Deletes a sub-device from a Zigbee network.

Parameter description

Parameter name Description
dip Sub-device ID

Return value

Return value Description
0 Success
Other values Failure

zigbee_set_tx_radio_power

Function prototype

external fun zigbee_set_tx_radio_power(tx_power: Int): Int

Functional description

Sets the tx_radio for the Zigbee module.

Parameter description

Parameter name Description
tx_power Value range: -70 to 20

Return value

Return value Description
0 Success
Other values Failure

zigbee_get_ncp_ver

Function prototype

external fun zigbee_get_ncp_ver():String

Functional description

Gets the Zigbee version number.

Return value

Return value Description
string Version number

devDelCallBack

Function prototype

fun devDelCallBack(devId: String, type: Int)

Functional description

Sub-device deletion callback.

Parameter description

Parameter name Description
devId Device ID
type Device type

devBindCallBack

Function prototype

fun devBindCallBack(devId: String, opRet: Int)

Functional description

Sub-device binding callback.

Parameter description

Parameter name Description
devId Device ID
opRet Action type

devHbCallBack

Function prototype

fun devHbCallBack(devId: String)

Functional description

Hb deletion callback.

Parameter description

Parameter name Description
devId Device ID

devUpgardeCallBack

Function prototype

fun devUpgardeCallBack(devId: String, fw: FwModel)

Functional description

Sub-device update callback.

Parameter description

Parameter name Description
devId Device ID
fw FwMdeol

devResetCallBack

Function prototype

fun devResetCallBack(devId: String, type: Int)

Functional description

Sub-device reset callback.

Parameter description

Parameter name Description
devId Device ID
type Device type

z3Join

Function prototype

fun z3Join(zigbeeZ3DESCMode: ZigbeeZ3DESCMode)

Functional description

Joining Zigbee network callback.

Parameter description

Parameter name Description
zigbeeZ3DESCMode ZigbeeZ3DESCMode type

z3_leave

Function prototype

fun z3_leave(dip: String)

Functional description

Leaving Zigbee network callback.

Parameter description

Parameter name Description
dip Device ID

z3_report

Function prototype

fun z3_report(zigbeeZ3ApsFrameMode: ZigbeeZ3ApsFrameMode)

Functional description

Zigbee cluster library (ZCL) data reporting callback.

Parameter description

Parameter name Description
zigbeeZ3ApsFrameMode ZigbeeZ3ApsFrameMode

z3_notify

Function prototype

fun z3_notify()

Functional description

Notification callback that gets invoked when the Zigbee module finishes starting up.

z3_upgrade_end

Function prototype

fun z3_upgrade_end(dip: String, rc: Int, version: Int)

Functional description

Notification callback that gets invoked when a firmware update is finished.

Parameter description

Parameter name Description
dip dip
rc rc
version Version number