|
Developing with ZBOSS for Zigbee
|
|
#define | ZB_ZDO_INVALID_TSN 0xFFU |
|
◆ zb_zdo_get_diag_data()
Obtains last known LQI and RSSI values from device with specified short address.
- Parameters
-
[in] | short_address | - address of device |
[in,out] | lqi | - pointer to zb_uint8_t variable to store lqi 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:
{
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:153
#define TRACE_MSG(lm, fmts, args)
Put trace output.
Definition: zb_trace.h:359
Definition: zb_zcl_common.h:1040
#define ZB_ZCL_FRAME_DIRECTION_TO_CLI
Definition: zb_zcl_common.h:958
#define ZB_MAC_LQI_UNDEFINED
Definition: zboss_api_nwk.h:160
#define ZB_BUF_GET_PARAM(buf, type)
Definition: zboss_api_buf.h:447
signed char zb_int8_t
Project-local 1-byte signed int type.
Definition: zb_types.h:155
Definition: zboss_api_zdo.h:1260
#define ZB_ZCL_PARSED_HDR_SHORT_DATA(header)
Extract common addressing data from parsed ZCL structure.
Definition: zb_zcl_common.h:1104
#define ZB_MAC_RSSI_UNDEFINED
Definition: zboss_api_nwk.h:164
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.
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.
#define zb_buf_get_out()
Definition: zboss_api_buf.h:238
zb_uint8_t cmd_direction
Definition: zb_zcl_common.h:1076
#define ZB_ZCL_COPY_PARSED_HEADER(buf, dst)
Copy parsed ZCL header from buffer.
Definition: zb_zcl_common.h:1354
#define ZB_APS_ADDR_MODE_16_ENDP_PRESENT
Definition: zboss_api_aps.h:107
Definition: zboss_api_zdo.h:1255
unsigned short zb_uint16_t
Project-local 2-byte unsigned int type.
Definition: zb_types.h:157
#define zb_buf_free(buf)
Free packet buffer and put it into free list.
Definition: zboss_api_buf.h:333
#define ZB_FALSE
Definition: zb_types.h:374
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:361
zb_uint8_t zb_bufid_t
Definition: zboss_api_buf.h:172