Tizen Native API
5.0
|
The Zigbee API provides functions for IoT connectivity.
#include <zigbee.h>
Zigbee service consists of Zigbee Device Object and Zigbee Cluster Library.
In order to use the above APIs, you must call zb_create() in advance. In addition, zb_destroy() should be called when Zigbee service is no longer needed.
You can also see our Zigbee Reference for more detailed descriptions of our library methods.
Note on callbacks: All callbacks in this module are called in the main loop context.
This API is related with the following features:
It is recommended to design applications with regard to features, for reliability.
You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on using features in your application can be found in the Feature List.
This section describes how to use Zigbee API.
To run the Zigbee coordinator, first create an instance through the zb_create function. After that, register an event_handler for event reception using zb_set_event_cb function. Once the event_handler is registered, enable the zigbee-service by enabling the zigbee-daemon by calling the zb_enable function. Finally, we call the zb_form_network function to form the Zigbee network.
Functions | |
int | zb_create (zb_zigbee_h *handle) |
Creates handle to access the zigbee service. | |
int | zb_destroy (zb_zigbee_h handle) |
Destroys to the zigbee service handle. | |
int | zb_enable (zb_zigbee_h handle) |
Enables the zigbee service. | |
int | zb_disable (zb_zigbee_h handle) |
Disables the zigbee service. | |
int | zb_set_event_cb (zb_zigbee_h handle, zb_event_cb event_handler) |
Sets the event handler to get events from the zigbee service. | |
int | zb_ev_get_enable_status (zb_event_data_h ev, zb_error_e *status) |
Gets status code of enable command. | |
int | zb_ev_get_form_network_panid (zb_event_data_h ev, zb_nwk_addr *pan_id) |
Gets PAN ID after forming a network. | |
int | zb_ev_get_join_count (zb_event_data_h ev, unsigned char *count) |
Gets the number of end-points of a joined device. | |
int | zb_ev_get_join_ep (zb_event_data_h ev, zb_end_point **ep) |
Gets the end-point list at a new device joined. | |
int | zb_ev_get_child_left_status (zb_event_data_h ev, zb_error_e *status) |
Gets the status code of leave request commands. | |
int | zb_ev_get_global_default_rsp_ep (zb_event_data_h ev, zb_end_point *ep) |
Gets the end-point number of the device which sent this default response. | |
int | zb_ev_get_global_default_rsp_cluster_id (zb_event_data_h ev, zb_cluster_id *clusterid) |
Gets the cluster id of the device which sent this default response. | |
int | zb_ev_get_global_default_rsp_command_id (zb_event_data_h ev, zb_command_id *commandid) |
Gets the command id of the device which sent this default response. | |
int | zb_ev_get_global_default_rsp_status (zb_event_data_h ev, zb_zcl_status_e *status) |
Gets status code of a default response of the global command request. | |
int | zb_ev_get_ias_noti_src_ep (zb_event_data_h ev, zb_end_point *src_ep) |
Gets the end-point number of the IAS notification. | |
int | zb_ev_get_ias_noti_zone_status (zb_event_data_h ev, unsigned short *zone_status) |
Gets zone status of the IAS notification. | |
int | zb_ev_get_ias_ext_noti_src_ep (zb_event_data_h ev, zb_end_point *src_ep) |
Gets the end-point number of the IAS extended notification. | |
int | zb_ev_get_ias_ext_noti_status (zb_event_data_h ev, unsigned char *status) |
Gets status of the IAS extended notification. | |
int | zb_ev_get_ias_ext_noti_zone_status (zb_event_data_h ev, unsigned short *zone_status) |
Gets zone status of the IAS extended notification. | |
int | zb_ev_get_ias_ext_noti_delay (zb_event_data_h ev, unsigned short *delay) |
Gets delay of the IAS extended notification. | |
int | zb_ev_get_ias_ext_noti_zone_id (zb_event_data_h ev, unsigned char *zone_id) |
Gets zone id of the IAS extended notification. | |
int | zb_ev_get_enroll_request_src_ep (zb_event_data_h ev, zb_end_point *src_ep) |
Gets the end-point number of the device which sent this enroll request. | |
int | zb_ev_get_enroll_request_zone_type (zb_event_data_h ev, zb_zcl_ias_zone_type_e *zone_type) |
Gets the zone type of the enroll request. | |
int | zb_ev_get_enroll_request_mfg_code (zb_event_data_h ev, unsigned char *mfg_code) |
Gets the manufacturer code of the enroll request. | |
int | zb_form_network (zb_zigbee_h handle, zb_form_network_cb cb, void *user_data) |
Makes the network work as a zigbee coordinator. | |
int | zb_disable_network (zb_zigbee_h handle, zb_disable_network_cb cb, void *user_data) |
Disables network and stops zigbee coordinator role. | |
int | zb_leave_device (zb_zigbee_h handle, zb_ieee_addr addr, bool remove_children, bool rejoin) |
Forces a node to leave one network and to rejoin the other. | |
int | zb_permit_join (zb_zigbee_h handle, unsigned char timeout) |
Allows or disallows the coordinator device to accept other device's association request. | |
int | zb_get_controller_mac_address (zb_zigbee_h handle, zb_ieee_addr addr64) |
Shows current coordinator's IEEE MAC address. | |
int | zb_get_network_info (zb_zigbee_h handle, zb_ieee_addr addr64, zb_nwk_addr *nodeid, zb_nwk_addr *panid, unsigned char *channel, unsigned char *tx_power) |
Gets information of the current network environment of coordinator. | |
Typedefs | |
typedef unsigned char | zb_ieee_addr [8] |
The data type abbreviation : IEEE Address. | |
typedef unsigned short | zb_nwk_addr |
The data type abbreviation : Network Address. | |
typedef unsigned char | zb_end_point |
The data type abbreviation : End Point. | |
typedef unsigned short | zb_device_id |
The data type abbreviation : Device ID. | |
typedef unsigned short | zb_profile_id |
The data type abbreviation : Profile ID. | |
typedef unsigned short | zb_cluster_id |
The data type abbreviation : Cluster ID. | |
typedef unsigned short | zb_attribute_id |
The data type abbreviation : Attribute ID. | |
typedef unsigned char | zb_command_id |
The data type abbreviation : Command ID. | |
typedef unsigned char | zb_aes128_key [16] |
The data type abbreviation : 128 bit security key. | |
typedef void * | zb_zigbee_h |
The handle of zigbee. | |
typedef void * | zb_event_data_h |
The event handle. | |
typedef void(* | zb_event_cb )(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e event_type, zb_event_data_h ev, void *user_data) |
Called after receiving events from zigbee service. | |
typedef void(* | zb_form_network_cb )(zb_nwk_addr panid, void *user_data) |
Called after zigbee network formation is completed. | |
typedef void(* | zb_disable_network_cb )(unsigned char status, void *user_data) |
Called after disabling the zigbee network. |
typedef unsigned char zb_aes128_key[16] |
The data type abbreviation : 128 bit security key.
typedef unsigned short zb_attribute_id |
The data type abbreviation : Attribute ID.
typedef unsigned short zb_cluster_id |
The data type abbreviation : Cluster ID.
typedef unsigned char zb_command_id |
The data type abbreviation : Command ID.
typedef unsigned short zb_device_id |
The data type abbreviation : Device ID.
typedef void(* zb_disable_network_cb)(unsigned char status, void *user_data) |
Called after disabling the zigbee network.
Response of disabling the zigbee network
[out] | status | ZB_ZDP_STATUS_SUCCESS ZB_ZDP_STATUS_NOT_SUPPORTED |
[out] | user_data | user data |
typedef unsigned char zb_end_point |
The data type abbreviation : End Point.
typedef void(* zb_event_cb)(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e event_type, zb_event_data_h ev, void *user_data) |
Called after receiving events from zigbee service.
This function can receive events from the devices in the network. ex) join, re-join, leave and attribute change report
[out] | addr16 | Network address (16 bit) from the source device |
[out] | addr64 | IEEE address (EUI64) from the source device |
[out] | event_type | The event identification |
[out] | ev | event data pointer |
[out] | user_data | User data |
typedef void* zb_event_data_h |
The event handle.
typedef void(* zb_form_network_cb)(zb_nwk_addr panid, void *user_data) |
Called after zigbee network formation is completed.
Response of forming the zigbee network
[out] | panid | PAN ID |
[out] | user_data | user data |
typedef unsigned char zb_ieee_addr[8] |
The data type abbreviation : IEEE Address.
typedef unsigned short zb_nwk_addr |
The data type abbreviation : Network Address.
typedef unsigned short zb_profile_id |
The data type abbreviation : Profile ID.
typedef void* zb_zigbee_h |
The handle of zigbee.
enum zb_device_id_e |
The device-specified HA profile.
enum zb_error_e |
Enumeration for zigbee CAPI error code.
enum zb_event_e |
The events for zb_event_cb().
enum zb_profile_id_e |
int zb_create | ( | zb_zigbee_h * | handle | ) |
Creates handle to access the zigbee service.
[out] | handle | The handle of zigbee |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_OUT_OF_MEMORY | Out-of-memory |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_destroy | ( | zb_zigbee_h | handle | ) |
Destroys to the zigbee service handle.
All this function to stop zigbee service
[in] | handle | The handle of zigbee |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_disable | ( | zb_zigbee_h | handle | ) |
Disables the zigbee service.
Call this function to stop the zigbee service.
[in] | handle | The handle of zigbee |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_NO_DATA | No data available |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_disable_network | ( | zb_zigbee_h | handle, |
zb_disable_network_cb | cb, | ||
void * | user_data | ||
) |
Disables network and stops zigbee coordinator role.
This function to stop zigbee coordinator
[in] | handle | The handle of zigbee |
[in] | cb | zb_disable_network_cb() |
[in] | user_data | user data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_enable | ( | zb_zigbee_h | handle | ) |
Enables the zigbee service.
All this function to start zigbee service
[in] | handle | The handle of zigbee |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_child_left_status | ( | zb_event_data_h | ev, |
zb_error_e * | status | ||
) |
Gets the status code of leave request commands.
[in] | ev | Event data structure |
[out] | status | The result of end-device left command |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_enable_status | ( | zb_event_data_h | ev, |
zb_error_e * | status | ||
) |
Gets status code of enable command.
[in] | ev | Event data structure |
[out] | status | The result of enable command |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_enroll_request_mfg_code | ( | zb_event_data_h | ev, |
unsigned char * | mfg_code | ||
) |
Gets the manufacturer code of the enroll request.
[in] | ev | Event data structure |
[out] | mfg_code | Manufacturer code |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_enroll_request_src_ep | ( | zb_event_data_h | ev, |
zb_end_point * | src_ep | ||
) |
Gets the end-point number of the device which sent this enroll request.
[in] | ev | Event data structure |
[out] | src_ep | Source end point |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_enroll_request_zone_type | ( | zb_event_data_h | ev, |
zb_zcl_ias_zone_type_e * | zone_type | ||
) |
Gets the zone type of the enroll request.
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_form_network_panid | ( | zb_event_data_h | ev, |
zb_nwk_addr * | pan_id | ||
) |
Gets PAN ID after forming a network.
[in] | ev | Event data structure |
[out] | pan_id | The result of enable command |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_global_default_rsp_cluster_id | ( | zb_event_data_h | ev, |
zb_cluster_id * | clusterid | ||
) |
Gets the cluster id of the device which sent this default response.
[in] | ev | Event data structure |
[out] | clusterid | The cluster id |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_global_default_rsp_command_id | ( | zb_event_data_h | ev, |
zb_command_id * | commandid | ||
) |
Gets the command id of the device which sent this default response.
[in] | ev | Event data structure |
[out] | commandid | The command id |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_global_default_rsp_ep | ( | zb_event_data_h | ev, |
zb_end_point * | ep | ||
) |
Gets the end-point number of the device which sent this default response.
[in] | ev | Event data structure |
[out] | ep | Source end point |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_global_default_rsp_status | ( | zb_event_data_h | ev, |
zb_zcl_status_e * | status | ||
) |
Gets status code of a default response of the global command request.
[in] | ev | Event data structure |
[out] | status | The result of the global command |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_ext_noti_delay | ( | zb_event_data_h | ev, |
unsigned short * | delay | ||
) |
Gets delay of the IAS extended notification.
[in] | ev | Event data structure |
[out] | delay | Delay |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_ext_noti_src_ep | ( | zb_event_data_h | ev, |
zb_end_point * | src_ep | ||
) |
Gets the end-point number of the IAS extended notification.
[in] | ev | Event data structure |
[out] | src_ep | Source end point |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_ext_noti_status | ( | zb_event_data_h | ev, |
unsigned char * | status | ||
) |
Gets status of the IAS extended notification.
[in] | ev | Event data structure |
[out] | status | Status |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_ext_noti_zone_id | ( | zb_event_data_h | ev, |
unsigned char * | zone_id | ||
) |
Gets zone id of the IAS extended notification.
[in] | ev | Event data structure |
[out] | zone_id | Zone id |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_ext_noti_zone_status | ( | zb_event_data_h | ev, |
unsigned short * | zone_status | ||
) |
Gets zone status of the IAS extended notification.
[in] | ev | Event data structure |
[out] | zone_status | Zone status Bit 0 : Alarm1 : 1 - opened or alarmed / 0 - closed or not alarmed Bit 1 : Alarm2 : 1 - opened or alarmed / 0 - closed or not alarmed Bit 2 : Temper : 1 - Tempered / 0 - Not tempered Bit 3 : Battery : 1 - Low battery / 0 - Battery OK Bit 4 : Supervision report : 1 - Report / 0 - Does not report Note 1: This bit indicates whether the Zone issues periodic Zone Status Change Notification commands. The CIE device may use these periodic reports as an indication that a zone is operational. Zones that do not implement the periodic reporting are required to set this bit to zero (the CIE will know not to interpret the lack of reports as a problem). Bit 5 : Restore reports : 1 - Reports restore / 0 - Does not report restore Note 2: This bit indicates whether or not a Zone Status Change Notification command will be sent to indicate that an alarm is no longer present. Some Zones do not have the ability to detect that alarm condition is no longer present, they only can tell that an alarm has occurred. These Zones must set the "Restore" bit to zero, indicating to the CIE not to look for alarm-restore notifications. Bit 6 : Trouble : 1 - Trouble/Failure / 0 - OK Bit 7 : AC(mains) : 1 - ACMains fault / 0 - AC/Mains OK |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_noti_src_ep | ( | zb_event_data_h | ev, |
zb_end_point * | src_ep | ||
) |
Gets the end-point number of the IAS notification.
[in] | ev | Event data structure |
[out] | src_ep | Source end point |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_ias_noti_zone_status | ( | zb_event_data_h | ev, |
unsigned short * | zone_status | ||
) |
Gets zone status of the IAS notification.
[in] | ev | Event data structure |
[out] | zone_status | Zone status Bit 0 : Alarm1 : 1 - opened or alarmed / 0 - closed or not alarmed Bit 1 : Alarm2 : 1 - opened or alarmed / 0 - closed or not alarmed Bit 2 : Temper : 1 - Tempered / 0 - Not tempered Bit 3 : Battery : 1 - Low battery / 0 - Battery OK Bit 4 : Supervision report : 1 - Report / 0 - Does not report Note 1: This bit indicates whether the Zone issues periodic Zone Status Change Notification commands. The CIE device may use these periodic reports as an indication that a zone is operational. Zones that do not implement the periodic reporting are required to set this bit to zero (the CIE will know not to interpret the lack of reports as a problem). Bit 5 : Restore reports : 1 - Reports restore / 0 - Does not report restore Note 2: This bit indicates whether or not a Zone Status Change Notification command will be sent to indicate that an alarm is no longer present. Some Zones do not have the ability to detect that alarm condition is no longer present, they only can tell that an alarm has occurred. These Zones must set the "Restore" bit to zero, indicating to the CIE not to look for alarm-restore notifications. Bit 6 : Trouble : 1 - Trouble/Failure / 0 - OK Bit 7 : AC(mains) : 1 - ACMains fault / 0 - AC/Mains OK |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_join_count | ( | zb_event_data_h | ev, |
unsigned char * | count | ||
) |
Gets the number of end-points of a joined device.
[in] | ev | Event data structure |
[out] | count | The number of end-points of a device joined to the network |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_ev_get_join_ep | ( | zb_event_data_h | ev, |
zb_end_point ** | ep | ||
) |
Gets the end-point list at a new device joined.
[in] | ev | Event data structure |
[out] | ep | The end point list |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_form_network | ( | zb_zigbee_h | handle, |
zb_form_network_cb | cb, | ||
void * | user_data | ||
) |
Makes the network work as a zigbee coordinator.
[in] | handle | The handle of zigbee |
[in] | cb | zb_form_network_cb() |
[in] | user_data | user data |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_get_controller_mac_address | ( | zb_zigbee_h | handle, |
zb_ieee_addr | addr64 | ||
) |
Shows current coordinator's IEEE MAC address.
The function gets the coordinator's MAC address from the machine which runs zigbee-service daemon.
[in] | handle | The handle of zigbee |
[out] | addr64 | the Zigbee IEEE MAC address of this machine. |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_get_network_info | ( | zb_zigbee_h | handle, |
zb_ieee_addr | addr64, | ||
zb_nwk_addr * | nodeid, | ||
zb_nwk_addr * | panid, | ||
unsigned char * | channel, | ||
unsigned char * | tx_power | ||
) |
Gets information of the current network environment of coordinator.
The function shows network environment
[in] | handle | The handle of zigbee |
[out] | addr64 | the Zigbee IEEE MAC address |
[out] | nodeid | Node ID |
[out] | panid | PAN ID |
[out] | channel | 11~26 : 2.4GHz~2.485GHz |
[out] | tx_power | Tx power strength |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_leave_device | ( | zb_zigbee_h | handle, |
zb_ieee_addr | addr, | ||
bool | remove_children, | ||
bool | rejoin | ||
) |
Forces a node to leave one network and to rejoin the other.
If remove_children is set to true, the target end device will reset its state-machine to factory defaults.
[in] | handle | The handle of zigbee |
[in] | addr | The source EUI64 of the binding (the remote device's EUI64) |
[in] | remove_children | Remove children |
[in] | rejoin | Rejoin after leave |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_permit_join | ( | zb_zigbee_h | handle, |
unsigned char | timeout | ||
) |
Allows or disallows the coordinator device to accept other device's association request.
[in] | handle | The handle of zigbee |
[in] | timeout | Number of seconds during which devices will be allowed to join the network. A value of 0xff turns permit joining on permanently |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_PERMISSION_DENIED | Permission denied |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |
int zb_set_event_cb | ( | zb_zigbee_h | handle, |
zb_event_cb | event_handler | ||
) |
Sets the event handler to get events from the zigbee service.
[in] | handle | The handle of zigbee |
[in] | event_handler | The event handler |
ZIGBEE_ERROR_NONE | Successful |
ZIGBEE_ERROR_INVALID_PARAMETER | Invalid parameter |
ZIGBEE_ERROR_IO_ERROR | Unexpected d-bus error |
ZIGBEE_ERROR_NOT_SUPPORTED | Not supported |