|
Developing with ZBOSS for Zigbee
|
|
#define | ZB_ZDO_INVALID_TSN 0xFFU |
|
◆ zb_zdo_get_diag_data()
Obtains last known LQA and RSSI values from device with specified short address.
- Parameters
-
[in] | short_address | - address of device |
[in,out] | lqa | - pointer to zb_uint8_t variable to store lqa value |
[in,out] | rssi | - pointer to zb_uint8_t variable to store rssi value |
Example:
{
TRACE_MSG(TRACE_APP1,
">> zcl_specific_cluster_cmd_handler", (FMT__0));
ZB_ZCL_DEBUG_DUMP_HEADER(&cmd_info);
TRACE_MSG(TRACE_APP3,
"lqi %hd rssi %d", (FMT__H_H, lqi, rssi));
{
TRACE_ERROR,
"Unsupported \"from server\" command direction",
(FMT__0));
}
TRACE_MSG(TRACE_APP1,
"<< zcl_specific_cluster_cmd_handler", (FMT__0));
}
◆ zb_zdo_get_diag_data_async()
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:
{
ZVUNUSED(resp_params);
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)
{
if (buf != ZB_BUF_INVALID)
{
ZB_BZERO(req, sizeof(*req));
req->short_address = short_address;
}
else
{
TRACE_MSG(TRACE_ERROR,
"Failed to get a buffer", (FMT__0));
}
}
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:147
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:369
Definition: zb_zcl_common.h:1156
#define ZB_ZCL_FRAME_DIRECTION_TO_CLI
Definition: zb_zcl_common.h:1064
#define ZB_MAC_LQI_UNDEFINED
Definition: zboss_api_nwk.h:203
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:457
void zb_zdo_get_diag_data(zb_uint16_t short_address, zb_uint8_t *lqa, zb_int8_t *rssi)
Obtains last known LQA and RSSI values from device with specified short address.
signed char zb_int8_t
Project-local 1-byte signed int type.
Definition: zb_types.h:149
Definition: zboss_api_zdo.h:1560
#define ZB_ZCL_PARSED_HDR_SHORT_DATA(header)
Extract common addressing data from parsed ZCL structure.
Definition: zb_zcl_common.h:1224
#define ZB_MAC_RSSI_UNDEFINED
Definition: zboss_api_nwk.h:207
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.
#define zb_buf_get_out()
Definition: zboss_api_buf.h:245
zb_uint8_t cmd_direction
Definition: zb_zcl_common.h:1195
#define ZB_ZCL_COPY_PARSED_HEADER(buf, dst)
Copy parsed ZCL header from buffer.
Definition: zb_zcl_common.h:1474
#define ZB_APS_ADDR_MODE_16_ENDP_PRESENT
Definition: zboss_api_aps.h:107
Definition: zboss_api_zdo.h:1555
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:151
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:344
#define ZB_FALSE
Definition: zb_types.h:349
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:372
zb_uint8_t zb_bufid_t
Definition: zboss_api_buf.h:178