nRF5 SDK for Thread and Zigbee v1.0.0
Macros | Typedefs | Enumerations | Functions
General application structure

Macros

#define ZB_INIT(trace_comment)   zb_init((zb_char_t *)trace_comment)
 
#define ZB_JOINED()   zb_zdo_joined()
 
#define ZB_SET_ED_TIMEOUT(to)   zb_nwk_set_ed_timeout(to)
 
#define ZB_SET_KEEPALIVE_TIMEOUT(to)   zb_nwk_set_keepalive_timeout(to)
 

Typedefs

typedef enum
nwk_requested_timeout_e 
nwk_requested_timeout_t
 

Enumerations

enum  nwk_requested_timeout_e {
  ED_AGING_TIMEOUT_10SEC = 0, ED_AGING_TIMEOUT_2MIN, ED_AGING_TIMEOUT_4MIN, ED_AGING_TIMEOUT_8MIN,
  ED_AGING_TIMEOUT_16MIN, ED_AGING_TIMEOUT_32MIN, ED_AGING_TIMEOUT_64MIN, ED_AGING_TIMEOUT_128MIN,
  ED_AGING_TIMEOUT_256MIN, ED_AGING_TIMEOUT_512MIN, ED_AGING_TIMEOUT_1024MIN, ED_AGING_TIMEOUT_2048MIN,
  ED_AGING_TIMEOUT_4096MIN, ED_AGING_TIMEOUT_8192MIN, ED_AGING_TIMEOUT_16384MIN
}
 

Functions

void zb_init (zb_char_t *trace_comment)
 Global stack initialization. More...
 
zb_void_t zb_set_channel (zb_uint32_t channel_mask)
 
zb_uint32_t zb_get_bdb_channel ()
 
zb_bool_t zb_bdb_is_factory_new ()
 
zb_void_t zb_set_rx_on_when_idle (zb_bool_t rx_on)
 
zb_bool_t zb_get_rx_on_when_idle ()
 
zb_ret_t zboss_start ()
 ZBOSS start function. More...
 
zb_char_tzb_get_version ()
 Get ZBOSS version. More...
 
zb_ret_t zboss_start_no_autostart ()
 
zb_ret_t zboss_start_in_sniffer_mode ()
 
void zboss_sniffer_start (zb_uint8_t channel, zb_callback_t data_ind_cb)
 
void zboss_sniffer_stop ()
 
zb_bool_t zb_zdo_joined ()
 
zb_void_t zboss_main_loop ()
 
zb_void_t zboss_main_loop_iteration ()
 
zb_void_t zb_set_long_address (zb_ieee_addr_t *addr)
 
zb_void_t zb_get_long_address (zb_ieee_addr_t *addr)
 
zb_void_t zb_set_node_descriptor_manufacturer_code (zb_uint16_t manuf_code)
 
void zb_set_network_coordinator_role (zb_uint32_t channel_mask)
 
void zb_set_network_coordinator_role_legacy (zb_uint32_t channel_mask)
 
void zb_set_network_router_role (zb_uint32_t channel_mask)
 
void zb_set_network_router_role_legacy (zb_uint32_t channel_mask)
 
void zb_set_network_ed_role (zb_uint32_t channel_mask)
 
void zb_set_network_ed_role_legacy (zb_uint32_t channel_mask)
 
zb_void_t zb_set_max_children (zb_uint8_t max_children)
 
void zb_nwk_set_ed_timeout (zb_uint_t to)
 
void zb_nwk_set_keepalive_timeout (zb_uint_t to)
 
zb_void_t zboss_signal_handler (zb_uint8_t param)
 

Detailed Description

Macro Definition Documentation

#define ZB_INIT (   trace_comment)    zb_init((zb_char_t *)trace_comment)

Global stack initialization.

To be called from main() at start.

Usual initialization sequence: zb_init(), then assign some IB values, then zboss_start().

Parameters
trace_comment- trace file name component (for Unix)

Example:

ZB_INIT("zdo_zc");

See any sample

#define ZB_JOINED ( )    zb_zdo_joined()

Checks that device joined to network.

Returns
true if device is joined; false - otherwise

Typedef Documentation

Enum all values used in End Device timeout request

Enumeration Type Documentation

Enum all values used in End Device timeout request

Enumerator
ED_AGING_TIMEOUT_10SEC 

10 second timeout

ED_AGING_TIMEOUT_2MIN 

2 minutes

ED_AGING_TIMEOUT_4MIN 

4 minutes

ED_AGING_TIMEOUT_8MIN 

8 minutes

ED_AGING_TIMEOUT_16MIN 

16 minutes

ED_AGING_TIMEOUT_32MIN 

32 minutes

ED_AGING_TIMEOUT_64MIN 

64 minutes

ED_AGING_TIMEOUT_128MIN 

128 minutes

ED_AGING_TIMEOUT_256MIN 

256 minutes

ED_AGING_TIMEOUT_512MIN 

512 minutes

ED_AGING_TIMEOUT_1024MIN 

1024 minutes

ED_AGING_TIMEOUT_2048MIN 

2048 minutes

ED_AGING_TIMEOUT_4096MIN 

4096 minutes

ED_AGING_TIMEOUT_8192MIN 

8192 minutes

ED_AGING_TIMEOUT_16384MIN 

16384 minutes

Function Documentation

zb_bool_t zb_bdb_is_factory_new ( )

Check if device is factory new.

Returns
ZB_TRUE if factory new. Example:
{
zb_zdo_rejoin_backoff_start(ZB_FALSE);
}
zb_void_t zb_get_long_address ( zb_ieee_addr_t addr)

Get 64-bit long address

Parameters
addr- pointer to memory where result will be stored
Returns
64-bit long address
zb_char_t* zb_get_version ( )

Get ZBOSS version.

Returns
Pointer to zero-terminated version string.
void zb_init ( zb_char_t trace_comment)

Global stack initialization.

Don't call directly, use ZB_INIT() instead

void zb_nwk_set_ed_timeout ( zb_uint_t  to)

Set end device timeout.

Use it on End Device to specify End Device timeout period used in ED Timeout request.

Parameters
to- index in nwk_requested_timeout_e
void zb_nwk_set_keepalive_timeout ( zb_uint_t  to)

Set keep alive timeout.

Use it on End Device to specify how often device should poll it's parent.

Parameters
to- timeout, in beacon intervals
zb_void_t zb_set_channel ( zb_uint32_t  channel_mask)

Set channel mask on device.

Parameters
channel_mask- ZigBee channel mask

Example:

zb_set_channel((1l<<13) | (1l<<14));
zb_void_t zb_set_long_address ( zb_ieee_addr_t addr)

Set 64-bit long address

Parameters
addr- long address structure
zb_void_t zb_set_max_children ( zb_uint8_t  max_children)

Set the maximum number of connected devices. Used for coordinators and routers

Parameters
max_children- maximum number of connected devices.
void zb_set_network_coordinator_role ( zb_uint32_t  channel_mask)

Initiate device as a ZigBee coordinator

Parameters
channel_mask- ZigBee channel mask
void zb_set_network_coordinator_role_legacy ( zb_uint32_t  channel_mask)

Initiate device as a legacy (pre-r21) ZigBee coordinator

Parameters
channel_mask- ZigBee channel mask
void zb_set_network_ed_role ( zb_uint32_t  channel_mask)

Initiate device as a ZigBee End Device

Parameters
channel_mask- ZigBee channel mask
void zb_set_network_ed_role_legacy ( zb_uint32_t  channel_mask)

Initiate device as a legacy (pre-r21) ZigBee End Device

Parameters
channel_mask- ZigBee channel mask
void zb_set_network_router_role ( zb_uint32_t  channel_mask)

Initiate device as a ZigBee router

Parameters
channel_mask- ZigBee channel mask
void zb_set_network_router_role_legacy ( zb_uint32_t  channel_mask)

Initiate device as a legacy (pre-r21) ZigBee router

Parameters
channel_mask- ZigBee channel mask
zb_void_t zb_set_rx_on_when_idle ( zb_bool_t  rx_on)

Set RxOnWhenIdle attribute

Parameters
rx_on- attribute value

Example:

zb_set_rx_on_when_idle(ZB_FALSE); // switch device to rx off
zb_void_t zboss_main_loop ( )

ZBOSS main loop. Must be called after ZB_INIT() and zboss_start(). Loops infinitely.

See any sample

zb_void_t zboss_main_loop_iteration ( )

ZBOSS main loop iteration. Must be called after ZB_INIT() and zboss_start() inside the application's main cycle.

zb_void_t zboss_signal_handler ( zb_uint8_t  param)

ZBOSS application signal handler.

Mandatory for all applications implemented on the top of ZBOSS stack.

Parameters
param- reference to the buffer which contains signal zb_zdo_app_signal_type_e
zb_ret_t zboss_start ( )

ZBOSS start function.

Typical device start: init, load some parameters from nvram and proceed with startup.

Startup means either Formation (for ZC), rejoin or discovery/association join. After startup complete zboss_signal_handler callback is called, so application will know when to do some useful things.

Precondition: stack must be inited by ZB_INIT() call. ZB_INIT() loads IB from NVRAM or set its defaults, so caller has a chance to change some parameters.

Note
: ZB is not looped in this routine. Instead, it schedules callback and returns. Caller must run zboss_main_loop() after this routine.
Returns
RET_OK on success.
zb_ret_t zboss_start_no_autostart ( )

Start ZBOSS with only minimal initialization, without starting commissioning.

This function initializes scheduler and buffers pool, but not MAC and upper layers. Typically zboss_start_no_autostart() is used when application is doing some additional initialization (HW init etc) and requires ZBOSS scheduler to be working. Application should later call ZBOSS commissioning initiation - for instance, bdb_start_top_level_commissioning().

Returns
RET_OK on success.

Documentation feedback | Developer Zone | Subscribe | Updated