Hello Nordic Team,
I have an application for Zigbee coordinator running on nrf52840. My use case is for the coordinator to move to another channel with less noise if the current channel is noisy. For this, I am trying to use this function zb_zdo_mgmt_nwk_update_req to perform energy scan. However, when the callback is triggered, I see the status as 133.
This is the code snippet on how I use the function zb_zdo_mgmt_nwk_update_req for energy scan.
bool EnergyScan(uint8_t channel) { zb_bufid_t bufid; zb_zdo_mgmt_nwk_update_req_t *req; zb_uint8_t zb_ret; uint32_t channelMask = 1UL << channel; bool ret = false; bufid = zb_buf_get_out(); if (bufid == ZB_BUF_INVALID) { PRINT("No Zigbee buffer available\r\n"); } else { req = ZB_BUF_GET_PARAM(bufid, zb_zdo_mgmt_nwk_update_req_t); ZB_CHANNEL_PAGE_SET_PAGE(req->hdr.scan_channels, ZB_CHANNEL_LIST_PAGE0_IDX); ZB_CHANNEL_PAGE_SET_MASK(req->hdr.scan_channels, channelMask); req->hdr.scan_duration = ZB_ZDO_NEW_ACTIVE_CHANNEL; req->dst_addr = ZB_NWK_BROADCAST_ALL_DEVICES; zb_ret = zb_zdo_mgmt_nwk_update_req(bufid, EnergyScan_cb); if (zb_ret != ZB_ZDO_INVALID_TSN) { ret = true; } else { zb_buf_free(bufid); } } return ret; } static void EnergyScan_cb(zb_uint8_t bufid) { zb_zdo_mgmt_nwk_update_notify_param_t * p_resp = (zb_zdo_mgmt_nwk_update_notify_param_t *)zb_buf_begin(bufid); PRINT("cb status %d, scanned ch %d list count %d energy %d %d %d %d %d %d %d %d \r\n",p_resp->hdr.status, p_resp->hdr.scanned_channels, p_resp->hdr.scanned_channels_list_count, p_resp->energy_values[0], p_resp->energy_values[1], p_resp->energy_values[2], p_resp->energy_values[3], p_resp->energy_values[4], p_resp->energy_values[5], p_resp->energy_values[6], p_resp->energy_values[7]); zb_buf_free(bufid); }
When the callback is executed, this is the kind of prints that I get:
cb status 133, scanned ch 1966080 list count 255 energy 198 0 34 140 112 197 0 8
I would like to know the following:
1. What does the value 133 for status mean?
2. Am I following the right approach for performing energy scan?
Can you please help address these questions?
Thanks,
Anusha