Tizen Native API  5.0
Zigbee

The Zigbee API provides functions for IoT connectivity.

Header

#include <zigbee.h>

Overview

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.

Zigbee Reference

Related Features

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.

Example

This section describes how to use Zigbee API.

Create Network

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 Documentation

typedef unsigned char zb_aes128_key[16]

The data type abbreviation : 128 bit security key.

Since :
5.0
typedef unsigned short zb_attribute_id

The data type abbreviation : Attribute ID.

Since :
5.0
typedef unsigned short zb_cluster_id

The data type abbreviation : Cluster ID.

Since :
5.0
typedef unsigned char zb_command_id

The data type abbreviation : Command ID.

Since :
5.0
typedef unsigned short zb_device_id

The data type abbreviation : Device ID.

Since :
5.0
typedef void(* zb_disable_network_cb)(unsigned char status, void *user_data)

Called after disabling the zigbee network.

Response of disabling the zigbee network

Since :
5.0
Parameters:
[out]statusZB_ZDP_STATUS_SUCCESS
ZB_ZDP_STATUS_NOT_SUPPORTED
[out]user_datauser data
See also:
zb_form_network()
typedef unsigned char zb_end_point

The data type abbreviation : End Point.

Since :
5.0
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

Since :
5.0
Remarks:
The ev should not be released.
The ev can be used only in the callback.
Parameters:
[out]addr16Network address (16 bit) from the source device
[out]addr64IEEE address (EUI64) from the source device
[out]event_typeThe event identification
[out]evevent data pointer
[out]user_dataUser data
Precondition:
The callback must be registered when using zb_set_event_handler()
See also:
ZB_ZDP_ENABLE_EVENT
ZB_ZDP_JOIN_EVENT
ZB_ZDP_REJOIN_EVENT
ZB_ZDP_LEAVE_DONE_EVENT
zb_event_cb()
typedef void* zb_event_data_h

The event handle.

Since :
5.0
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

Since :
5.0
Parameters:
[out]panidPAN ID
[out]user_datauser data
See also:
zb_form_network()
typedef unsigned char zb_ieee_addr[8]

The data type abbreviation : IEEE Address.

Since :
5.0
typedef unsigned short zb_nwk_addr

The data type abbreviation : Network Address.

Since :
5.0
typedef unsigned short zb_profile_id

The data type abbreviation : Profile ID.

Since :
5.0
typedef void* zb_zigbee_h

The handle of zigbee.

Since :
5.0

Enumeration Type Documentation

The device-specified HA profile.

Since :
5.0
Enumerator:
ZB_HA_DEV_ON_OFF_SWITCH 

On/off switch device

ZB_HA_DEV_LEVEL_CONTROL_SWITCH 

Level control device

ZB_HA_DEV_ON_OFF_OUTPUT 

On/off output device

ZB_HA_DEV_LEVEL_CONTROLLABLE_OUTPUT 

Controllable output device

ZB_HA_DEV_SCENE_SELECTOR 

Scene selector device

ZB_HA_DEV_CONFIGURATION_TOOL 

Configuration tool device

ZB_HA_DEV_REMOTE_CONTROL 

Remote control device

ZB_HA_DEV_COMBINED_INTERFACE 

Combined interface device

ZB_HA_DEV_RANGE_EXTENDER 

Range extender device

ZB_HA_DEV_MAINS_POWER_OUTLET 

Mains power outlet device

ZB_HA_DEV_DOOR_LOCK 

Door lock device

ZB_HA_DEV_DOOR_LOCK_CONTROLLER 

Door lock controller device

ZB_HA_DEV_SIMPLE_SENSOR 

Simple sensor device

ZB_HA_DEV_CONSUMPTION_AWARENESS_DEVICE 

Consumption awareness device

ZB_HA_DEV_HOME_GATEWAY 

Home gateway device

ZB_HA_DEV_SMART_PLUG 

Smart plug device

ZB_HA_DEV_WHITE_GOODS 

White goods device

ZB_HA_DEV_METER_INTERFACE 

Meter interface device

ZB_HA_DEV_ON_OFF_LIGHT 

On/off light device

ZB_HA_DEV_DIMMABLE_LIGHT 

Dimmable light device

ZB_HA_DEV_COLOR_DIMMABLE_LIGHT 

Color dimmable light device

ZB_HA_DEV_ON_OFF_LIGHT_SWITCH 

On/off light device

ZB_HA_DEV_DIMMER_SWITCH 

Dimmer switch device

ZB_HA_DEV_COLOR_DIMMER_SWITCH 

Color dimmer switch device

ZB_HA_DEV_LIGHT_SENSOR 

Light sensor device

ZB_HA_DEV_OCCUPANCY_SENSOR 

Occupancy sensor device

ZB_HA_DEV_SHADE 

Shade device

ZB_HA_DEV_SHADE_CONTROLLER 

Shade controller device

ZB_HA_DEV_WINDOW_COVERING_DEVICE 

Window covering device

ZB_HA_DEV_WINDOW_COVERING_CONTROLLER 

Window covering controller device

ZB_HA_DEV_HEATING_COOLING_UNIT 

Heating cooling device

ZB_HA_DEV_THERMOSTAT 

Thermostat device

ZB_HA_DEV_TEMPERATURE_SENSOR 

Temperature sensor device

ZB_HA_DEV_PUMP 

Pump device

ZB_HA_DEV_PUMP_CONTROLLER 

Pump controller device

ZB_HA_DEV_PRESSURE_SENSOR 

Pressure sensor device

ZB_HA_DEV_FLOW_SENSOR 

Flow sensor device

ZB_HA_DEV_MINI_SPLIT_AC 

Mini split device

ZB_HA_DEV_IAS_CONTROL_AND_INDICATING_EQUIPMENT 

IAS control and indicating equipment device

ZB_HA_DEV_IAS_ANCILLARY_CONTROL_EQUIPMENT 

IAS ancillary control device

ZB_HA_DEV_IAS_ZONE 

IAS zone device

ZB_HA_DEV_IAS_WARNING_DEVICE 

IAS warning device

enum zb_error_e

Enumeration for zigbee CAPI error code.

Since :
5.0
Enumerator:
ZIGBEE_ERROR_NONE 

Successful

ZIGBEE_ERROR_INVALID_PARAMETER 

Invalid parameter

ZIGBEE_ERROR_PARAMETER_OUT_OF_RANGE 

Out of range

ZIGBEE_ERROR_OUT_OF_MEMORY 

Out of memory

ZIGBEE_ERROR_IO_ERROR 

DBus error

ZIGBEE_ERROR_NO_DATA 

No data available

ZIGBEE_ERROR_NOT_SUPPORTED 

Not supported

ZIGBEE_ERROR_PERMISSION_DENIED 

Permission denied

ZIGBEE_ERROR_INVALID_ENDPOINT 

Endpoint 0 is reserved for ZDP

ZIGBEE_ERROR_INVALID_ADDRESS 

Wrong address

ZIGBEE_ERROR_OPERATION_FAILED 

Operation failed

enum zb_event_e

The events for zb_event_cb().

Since :
5.0
Enumerator:
ZB_ZDP_ENABLE_EVENT 

This event is received after enabling zigbee system service

ZB_ZDP_FORM_NETWORK_DONE 

This event comes from coming network operation completed

ZB_ZDP_JOIN_EVENT 

This event takes place when a new device joins

ZB_ZDP_REJOIN_EVENT 

This event takes place when an existing device or devices which are received 'leave_network' command are re-joined

ZB_ZDP_CHILD_LEFT 

This event takes place when a child device leaves current network explicitly

ZB_ZDP_LEAVE_DONE_EVENT 

This event will take place after dismissing the current network

ZB_ZCL_GLOBAL_DEFAULT_RSP_EVENT 

This event is used when global default response

ZB_ZCL_IAS_ZONE_ENROLL_REQUEST_EVENT 

A Device which supports IAS zone cluster wants to register its ability

ZB_ZCL_IAS_ZONE_STATUS_CHANGE_NOTIFICATION_EVENT 

A Device which supports IAS zone cluster announces its status change

ZB_ZCL_IAS_ZONE_STATUS_CHANGE_EXTENDED_NOTIFICATION_EVENT 

A Device which supports IAS zone cluster announces its status change

Zigbee profile id.

Since :
5.0
Enumerator:
ZB_PROFILE_HOME_AUTOMATION 

Zigbee Home Automation profile


Function Documentation

int zb_create ( zb_zigbee_h handle)

Creates handle to access the zigbee service.

Since :
5.0
Remarks:
The handle should be released using zb_destroy().
Parameters:
[out]handleThe handle of zigbee
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_OUT_OF_MEMORYOut-of-memory
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_destroy()
int zb_destroy ( zb_zigbee_h  handle)

Destroys to the zigbee service handle.

All this function to stop zigbee service

Since :
5.0
Parameters:
[in]handleThe handle of zigbee
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_create()
int zb_disable ( zb_zigbee_h  handle)

Disables the zigbee service.

Warning:
This is not for use by third-party applications.

Call this function to stop the zigbee service.

Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/zigbee.admin
Remarks:
You must free all resources of the zigbee by calling zb_destroy() if zigbee service is no longer needed.
Parameters:
[in]handleThe handle of zigbee
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_NO_DATANo data available
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_create()
zb_destroy()
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

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Parameters:
[in]handleThe handle of zigbee
[in]cbzb_disable_network_cb()
[in]user_datauser data
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_form_network()
int zb_enable ( zb_zigbee_h  handle)

Enables the zigbee service.

Warning:
This is not for use by third-party applications.

All this function to start zigbee service

Since :
5.0
Privilege Level:
platform
Privilege:
http://tizen.org/privilege/zigbee.admin
Remarks:
You must free all resources of the zigbee by calling zb_destroy() if zigbee service is no longer needed.
Parameters:
[in]handleThe handle of zigbee
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_create()
zb_destroy()

Gets the status code of leave request commands.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]statusThe result of end-device left command
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets status code of enable command.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]statusThe result of enable command
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]mfg_codeManufacturer code
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the end-point number of the device which sent this enroll request.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]src_epSource end point
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets PAN ID after forming a network.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]pan_idThe result of enable command
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the cluster id of the device which sent this default response.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]clusteridThe cluster id
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the command id of the device which sent this default response.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]commandidThe command id
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the end-point number of the device which sent this default response.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]epSource end point
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets status code of a default response of the global command request.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]statusThe result of the global command
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
int zb_ev_get_ias_ext_noti_delay ( zb_event_data_h  ev,
unsigned short *  delay 
)

Gets delay of the IAS extended notification.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]delayDelay
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the end-point number of the IAS extended notification.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]src_epSource end point
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
int zb_ev_get_ias_ext_noti_status ( zb_event_data_h  ev,
unsigned char *  status 
)

Gets status of the IAS extended notification.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]statusStatus
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]zone_idZone id
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]zone_statusZone 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
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the end-point number of the IAS notification.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]src_epSource end point
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]zone_statusZone 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
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Parameters:
[in]evEvent data structure
[out]countThe number of end-points of a device joined to the network
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported

Gets the end-point list at a new device joined.

Since :
5.0
Remarks:
The ep should be released using free().
Parameters:
[in]evEvent data structure
[out]epThe end point list
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_NOT_SUPPORTEDNot 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.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Remarks:
If you want to change parameters related to network configuration you should call zb_zdo_set_compatible_startup_parameters() function.
Parameters:
[in]handleThe handle of zigbee
[in]cbzb_form_network_cb()
[in]user_datauser data
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
Postcondition:
When forming network is finished, form_network_done event will be generated.
See also:
zb_disable_network()
zb_zdo_set_compatible_startup_parameters()

Shows current coordinator's IEEE MAC address.

The function gets the coordinator's MAC address from the machine which runs zigbee-service daemon.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Parameters:
[in]handleThe handle of zigbee
[out]addr64the Zigbee IEEE MAC address of this machine.
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_get_network_info()
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

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Parameters:
[in]handleThe handle of zigbee
[out]addr64the Zigbee IEEE MAC address
[out]nodeidNode ID
[out]panidPAN ID
[out]channel11~26 : 2.4GHz~2.485GHz
[out]tx_powerTx power strength
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_form_network()
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.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Parameters:
[in]handleThe handle of zigbee
[in]addrThe source EUI64 of the binding (the remote device's EUI64)
[in]remove_childrenRemove children
[in]rejoinRejoin after leave
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_form_network()
int zb_permit_join ( zb_zigbee_h  handle,
unsigned char  timeout 
)

Allows or disallows the coordinator device to accept other device's association request.

Since :
5.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/zigbee
Remarks:
Especially, this can be very useful for disabling joining all throughout the network. Typically, this is the last step when commissioning a network. It closes it down to prevent other nodes getting on the network without permission.
Parameters:
[in]handleThe handle of zigbee
[in]timeoutNumber of seconds during which devices will be allowed to join the network. A value of 0xff turns permit joining on permanently
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_PERMISSION_DENIEDPermission denied
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_form_network()
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.

Since :
5.0
Parameters:
[in]handleThe handle of zigbee
[in]event_handlerThe event handler
Returns:
0 on success, otherwise a negative error value.
Return values:
ZIGBEE_ERROR_NONESuccessful
ZIGBEE_ERROR_INVALID_PARAMETERInvalid parameter
ZIGBEE_ERROR_IO_ERRORUnexpected d-bus error
ZIGBEE_ERROR_NOT_SUPPORTEDNot supported
See also:
zb_create()
zb_destroy()