This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

zb_zdo_active_ep_req - gives invalid data in callback when device is not found.

When running the Zboss stack to get active endpoint on a disconnected devices some fields are not populated correctly in the responce.

tsn OK

status FF might be OK

nwk_addr 0x00f1 Is not the correct value, the device I was sending to has addr 0xf11b

ep_count OK 0

void active_enpoints_callback(zb_uint8_t param)
{
    zb_buf_t*         buf  = ZB_BUF_FROM_REF(param);
    zb_zdo_ep_resp_t* resp = (zb_zdo_ep_resp_t *)ZB_BUF_BEGIN(buf);
    if (resp->status != ZB_ZDP_STATUS_SUCCESS)
    {
        LOG("active_enpoints_callback: Failed -> 0x%02hX %s\n", resp->tsn, zdp_status_to_string(resp->status));
    }
    else
    {
        LOG("TODO - For now asume the last endpoint is the one we are looking for 0x%02hx\n", resp->ep_count);
        get_node_simp_desc(resp->nwk_addr, resp->ep_count);
    }
   
    ZB_FREE_BUF_BY_REF(param);
}

        zb_zdo_active_ep_req_t *req;
        ZB_BUF_INITIAL_ALLOC(asdu, sizeof(zb_zdo_active_ep_req_t), req);
        req->nwk_addr = addr;
        zb_uint8_t tsn = zb_zdo_active_ep_req(ZB_REF_FROM_BUF(asdu), active_enpoints_callback);
        if (tsn == 0xFF)
        {
            LOG("error\n", NULL);
            zb_free_buf(asdu);
            return;
        }
        LOG("active endpoits tsn: 0x%02hX\n", tsn);

Parents Reply Children
No Data
Related