|
Developing with ZBOSS for Zigbee
|
|
zb_ret_t | zb_address_get_pan_id_ref (zb_ext_pan_id_t pan_id, zb_address_pan_id_ref_t *ref) |
|
void | zb_address_get_short_pan_id (zb_address_pan_id_ref_t pan_id_ref, zb_uint16_t *pan_id_p) |
|
zb_bool_t | zb_address_cmp_pan_id_by_ref (zb_address_pan_id_ref_t pan_id_ref, zb_ext_pan_id_t pan_id) |
|
zb_ret_t | zb_address_update (zb_ieee_addr_t ieee_address, zb_uint16_t short_address, zb_bool_t lock, zb_address_ieee_ref_t *ref_p) |
|
void | zb_long_address_update_by_ref (zb_ieee_addr_t ieee_address, zb_address_ieee_ref_t ref) |
|
void | zb_address_by_ref (zb_ieee_addr_t ieee_address, zb_uint16_t *short_address_p, zb_address_ieee_ref_t ref) |
|
void | zb_address_ieee_by_ref (zb_ieee_addr_t ieee_address, zb_address_ieee_ref_t ref) |
|
void | zb_address_short_by_ref (zb_uint16_t *short_address_p, zb_address_ieee_ref_t ref) |
|
zb_ret_t | zb_address_by_ieee (const zb_ieee_addr_t ieee, zb_bool_t create, zb_bool_t lock, zb_address_ieee_ref_t *ref_p) |
|
zb_uint16_t | zb_address_short_by_ieee (zb_ieee_addr_t ieee_address) |
|
zb_ret_t | zb_address_ieee_by_short (zb_uint16_t short_addr, zb_ieee_addr_t ieee_address) |
|
zb_ret_t | zb_address_by_short (zb_uint16_t short_address, zb_bool_t create, zb_bool_t lock, zb_address_ieee_ref_t *ref_p) |
|
zb_bool_t | zb_address_is_locked (zb_address_ieee_ref_t ref) |
|
zb_ret_t | zb_address_lock (zb_address_ieee_ref_t ref) |
|
void | zb_address_unlock (zb_address_ieee_ref_t ref) |
|
zb_ret_t | zb_address_delete (zb_address_ieee_ref_t ref) |
|
◆ zb_address_ieee_ref_t
IEEE address reference
Should be used inside protocol tables instead of 64/16-bit IEEE.
◆ zb_address_pan_id_ref_t
Pan ID reference
Should be used inside protocol tables instead of 64-bit Pan ID
◆ zb_address_by_ieee()
Get address ref by long address, optionally create if not exist, optionally lock. Update address alive time if not locked.
- Parameters
-
ieee | - IEEE device address |
create | - if TRUE, create address entry if it does not exist |
lock | - if TRUE, lock address entry |
ref_p | - (out) address reference |
- Note
- : never call zb_address_by_ieee() with empty (zero) ieee_address
- Returns
- RET_OK or error code
Example
See nwk_addr sample
◆ zb_address_by_ref()
Get address with address reference.
Get existing IEEE (long) and short addresses with address reference. Update address alive time if it not locked.
- Parameters
-
ieee_address | - (out) long address |
short_address_p | - (out) short address |
ref | - address reference |
Example
See nwk_addr sample
◆ zb_address_by_short()
Get address reference with long address. Create the reference if it does not exist. Optionally, lock the address. Update address alive time if not locked.
- Parameters
-
short_address | - 16bit device address |
create | - if TRUE, create address entry if it does not exist |
lock | - if TRUE, lock address entry |
ref_p | - (out) address reference |
- Note
- Never call zb_address_by_short() with empty (-1) short_address
- Returns
- RET_OK or error code
Example
{
{
req_param->
rejoin = (rejoin_flag ? 1 : 0);
}
else
{
TRACE_MSG(TRACE_APP1, "tried to remove 0x%xd, but device is already left", (FMT__D, short_addr));
}
}
See simple_gw sample
◆ zb_address_cmp_pan_id_by_ref()
Compare Pan ID in the source form with Pan ID reference.
- Parameters
-
pan_id_ref | - Pan ID ref |
pan_id | - Pan ID (64-bit) |
- Returns
- ZB_TRUE if addresses are equal, ZB_FALSE otherwise
Example
for (i = 0 ; i < ZG->nwk.neighbor.ext_neighbor_used ; ++i)
{
for (j = 0 ; j < n_nwk_dsc &&
++j)
{
...
}
}
◆ zb_address_delete()
Delete address.
- Returns
- RET_OK or RET_ERROR
- Parameters
-
ref | - IEEE/network address pair reference |
◆ zb_address_get_pan_id_ref()
Get Pan ID reference with extended Pan ID.
- Parameters
-
pan_id | - Pan ID |
ref | - (output) reference to Pan ID |
- Returns
- RET_OK - when success, error code otherwise.
Example
{
TRACE_MSG(TRACE_NWK1, "Pan ID " TRACE_FORMAT_64 " not in Pan ID arr - ?", (FMT__A,
TRACE_ARG_64(ZB_NIB_EXT_PAN_ID())));
}
◆ zb_address_get_short_pan_id()
Get short Pan ID with reference.
- Parameters
-
pan_id_ref | - reference to Pan ID |
pan_id_p | - (output) Pan ID. |
Example
if (nt_panid == pan_id)
{
TRACE_MSG(TRACE_NWK1, "pan_id %d is on ch %hd", (FMT__D_H, pan_id, channel));
unique_pan_id = 0;
}
◆ zb_address_ieee_by_ref()
Get IEEE address with address reference.
Get existing IEEE address(long address) with address reference. Update address alive time if it not locked.
- Parameters
-
ieee_address | - (out) long address |
ref | - address reference |
Example
void func(zb_neighbor_tbl_ent_t *nbt)
{
...
}
See tp_pro_bv-32 sample
◆ zb_address_ieee_by_short()
Get IEEE address (long) with short address.
- Parameters
-
short_addr | - short address |
ieee_address | - (out)long address |
- Returns
- RET_OK or RET_NOT_FOUND
Example
{
TRACE_MSG(TRACE_ERROR, "get ieee address by short failed", (FMT__0));
return;
}
See light_sample
◆ zb_address_is_locked()
Check that address is locked (has lock counter > 0)
- Parameters
-
ref | - IEEE/network address pair reference |
- Returns
- ZB_TRUE if address is locked
◆ zb_address_lock()
Increase address lock counter, when it used in some table. Address must be already locked.
- Parameters
-
ref | - IEEE/network address pair reference |
- Returns
- RET_OK or RET_ERROR
◆ zb_address_short_by_ieee()
Get short address by IEEE address (long).
- Parameters
-
ieee_address | - long address |
- Returns
- short address if ok, -1 otherwise.
- Example
See thermostat sample
◆ zb_address_short_by_ref()
Get short address by address reference.
Get existing short address with address reference. Update address alive time if it not locked.
- Parameters
-
short_address_p | - (out) short address |
ref | - address reference |
Example
zb_neighbor_tbl_ent_t *nbt;
if(zb_nwk_neighbor_with_address_conflict(&nbt)==
RET_OK)
{
func(addr);
}
See tp_pro_bv-32 sample
◆ zb_address_unlock()
Unlock address counter. Decrease lock counter.
- Parameters
-
ref | - IEEE/network address pair reference |
◆ zb_address_update()
Update long/short address pair. Create the pair if not exist. Optionally, lock. Reaction on device announce etc. Long and short addresses are present. Must synchronize the address translation table with this information.
- Note
- Never call zb_address_update() with empty (zero) ieee_address or empty (-1) short_address.
- Parameters
-
ieee_address | - long address |
short_address | - short address |
lock | - if TRUE, lock address entry |
ref_p | - (out) address reference |
- Returns
- RET_OK or error code
Example
See nwk_addr sample
NWK_addr_req response frame.
Definition: zboss_api_zdo.h:1225
zb_uint16_t dst_addr
Definition: zboss_api_zdo.h:2409
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:149
zb_uint16_t nwk_addr
Definition: zboss_api_zdo.h:1230
zb_ret_t zb_address_get_pan_id_ref(zb_ext_pan_id_t pan_id, zb_address_pan_id_ref_t *ref)
void zb_address_short_by_ref(zb_uint16_t *short_address_p, zb_address_ieee_ref_t ref)
zb_uint8_t zb_bool_t
General purpose boolean type. For C90, 'zb_bool_t' is an alias of 'zb_uint8_t'. For C99,...
Definition: zb_types.h:367
#define ZB_SCHEDULE_APP_CALLBACK(func, param)
Definition: zboss_api_core.h:303
#define ZB_LETOH16
Definition: zb_types.h:790
zb_uint8_t zdo_mgmt_leave_req(zb_uint8_t param, zb_callback_t cb)
Sends Mgmt_Leave_req.
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:456
#define ZB_TRUE
Definition: zb_types.h:371
@ ZB_BDB_COMM_BIND_SUCCESS
Definition: zboss_api_zcl.h:2079
zb_bitfield_t rejoin
Definition: zboss_api_zdo.h:2413
zb_ret_t zb_address_ieee_by_short(zb_uint16_t short_addr, zb_ieee_addr_t ieee_address)
#define ZB_ZDP_STATUS_SUCCESS
Definition: zboss_api_zdo.h:41
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:344
zb_64bit_addr_t zb_ieee_addr_t
Long (64-bit) device address.
Definition: zb_types.h:550
#define RET_OK
Error codes for non-void stack functions. In general, function can return OK, BLOCKED or some error....
Definition: zb_errors.h:77
zb_uint8_t zb_address_ieee_ref_t
Definition: zb_address.h:64
zb_ieee_addr_t ieee_addr
Definition: zboss_api_zdo.h:1229
zb_uint8_t zb_address_pan_id_ref_t
Definition: zb_address.h:56
zb_uint16_t device_short_addr
Definition: zboss_api_zdo.h:878
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:153
zb_ret_t zb_address_by_short(zb_uint16_t short_address, zb_bool_t create, zb_bool_t lock, zb_address_ieee_ref_t *ref_p)
zb_bool_t zb_address_cmp_pan_id_by_ref(zb_address_pan_id_ref_t pan_id_ref, zb_ext_pan_id_t pan_id)
void zb_address_get_short_pan_id(zb_address_pan_id_ref_t pan_id_ref, zb_uint16_t *pan_id_p)
zb_ret_t zb_address_by_ieee(const zb_ieee_addr_t ieee, zb_bool_t create, zb_bool_t lock, zb_address_ieee_ref_t *ref_p)
Request for Mgmt_Leave_req.
Definition: zboss_api_zdo.h:2406
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:334
#define ZB_FALSE
Definition: zb_types.h:370
zb_ret_t zb_address_update(zb_ieee_addr_t ieee_address, zb_uint16_t short_address, zb_bool_t lock, zb_address_ieee_ref_t *ref_p)
zb_uint8_t status
Definition: zboss_api_zdo.h:1228
zb_uint16_t zb_address_short_by_ieee(zb_ieee_addr_t ieee_address)
zb_uint8_t zb_bufid_t
Definition: zboss_api_buf.h:172
void zb_address_by_ref(zb_ieee_addr_t ieee_address, zb_uint16_t *short_address_p, zb_address_ieee_ref_t ref)
void zb_address_ieee_by_ref(zb_ieee_addr_t ieee_address, zb_address_ieee_ref_t ref)
#define ZB_ZCL_CLUSTER_ID_THERMOSTAT
Definition: zb_zcl_common.h:242