Developing with ZBOSS for Zigbee
ZDO base constants and definitions

Data Structures

struct  zb_zdo_callback_info_s
 
struct  zb_zdo_default_resp_s
 
struct  zb_zdo_get_diag_data_req_params_s
 
struct  zb_zdo_get_diag_data_resp_params_s
 

Macros

#define ZB_ZDO_INVALID_TSN   0xFFU
 

Typedefs

typedef struct zb_zdo_callback_info_s zb_zdo_callback_info_t
 
typedef struct zb_zdo_default_resp_s zb_zdo_default_resp_t
 
typedef struct zb_zdo_get_diag_data_req_params_s zb_zdo_get_diag_data_req_params_t
 
typedef struct zb_zdo_get_diag_data_resp_params_s zb_zdo_get_diag_data_resp_params_t
 

Functions

void zb_zdo_get_diag_data (zb_uint16_t short_address, zb_uint8_t *lqi, zb_int8_t *rssi)
 Obtains last known LQI and RSSI values from device with specified short address. More...
 
zb_ret_t zb_zdo_get_diag_data_async (zb_bufid_t buf, zb_callback_t cb)
 Obtains last known LQI and RSSI values from the device with the specified short address. More...
 

Detailed Description

Function Documentation

◆ zb_zdo_get_diag_data()

void zb_zdo_get_diag_data ( zb_uint16_t  short_address,
zb_uint8_t lqi,
zb_int8_t rssi 
)

Obtains last known LQI and RSSI values from device with specified short address.

Parameters
short_address- address of device
lqi[in] - pointer to zb_uint8_t variable to store lqi value
rssi[in] - pointer to zb_uint8_t variable to store rssi value

Example:

zb_uint8_t lqi, rssi;
zb_zdo_get_diag_data(0x0000, &lqi, &rssi);

◆ zb_zdo_get_diag_data_async()

zb_ret_t zb_zdo_get_diag_data_async ( zb_bufid_t  buf,
zb_callback_t  cb 
)

Obtains last known LQI and RSSI values from the device with the specified short address.

Parameters
buf- a buffer with request params, see zb_zdo_get_diag_data_req_params_t
cb- a user's function to call when the response is ready. See zb_zdo_get_diag_data_resp_params_t for response params description.
Returns
status, RET_OK - request successfully sent, RET_INVALID_PARAMETER_1 if buf is ZB_BUF_INVALID, RET_INVALID_PARAMETER_2 if cb is NULL, RET_BUSY if this request can't be served at the moment

Example:

static void handle_diag_data_resp(zb_bufid_t buf)
{
TRACE_MSG(TRACE_APP1, "handle_diag_data_resp, status: %d, addr: 0x%x, lqi: %d, rssi: %d",
(FMT__D_D_D_D, resp_params->status, resp_params->short_address,
resp_params->lqi, resp_params->rssi));
}
static void send_diag_data_req(zb_uint16_t short_address)
{
buf = zb_buf_get_out();
if (buf != ZB_BUF_INVALID)
{
ZB_BZERO(req, sizeof(*req));
req->short_address = short_address;
zb_zdo_get_diag_data_async(buf, handle_diag_data_resp);
}
else
{
TRACE_MSG(TRACE_ERROR, "Failed to get a buffer", (FMT__0));
}
}
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:149
TRACE_MSG
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:348
ZB_BUF_GET_PARAM
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:455
zb_zdo_get_diag_data_resp_params_s
Definition: zboss_api_zdo.h:1147
zb_zdo_get_diag_data_async
zb_ret_t zb_zdo_get_diag_data_async(zb_bufid_t buf, zb_callback_t cb)
Obtains last known LQI and RSSI values from the device with the specified short address.
zb_zdo_get_diag_data
void zb_zdo_get_diag_data(zb_uint16_t short_address, zb_uint8_t *lqi, zb_int8_t *rssi)
Obtains last known LQI and RSSI values from device with specified short address.
zb_buf_get_out
#define zb_buf_get_out()
Definition: zboss_api_buf.h:238
zb_zdo_get_diag_data_req_params_s
Definition: zboss_api_zdo.h:1142
zb_uint16_t
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:153
zb_buf_free
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:333
zb_bufid_t
zb_uint8_t zb_bufid_t
Definition: zboss_api_buf.h:172