zigbee

Hi

For nRF52840 as Zigbee Coordinator, for an unknown new device (ED), after the new device joins the Zigbee network,

  1. Is it possible to know the Profile, End-Point, Clusters, etc. properties supported by this device?
  2. Is it possible to know the real-time dynamic link status, link quality of the connected device?
  • Hi,

    Is it possible to know the Profile, End-Point, Clusters, etc. properties supported by this device?

    Yes, you can send a Simple Descriptor Request to the device, using zb_zdo_simple_desc_req():

    static void send_simple_desc_req(zb_bufid_t buf)
    {
        if (!buf)
        {
            zb_buf_get_out_delayed(send_simple_desc_req);
        }
        else
        {
            zb_zdo_simple_desc_req_t *req;
            req = zb_buf_initial_alloc(buf, sizeof(zb_zdo_simple_desc_req_t));
            req->nwk_addr = 0; /* send to coordinator */
            req->endpoint = 5;
            zb_zdo_simple_desc_req(buf, simple_desc_callback);
        }
    }

    When the coordinator receives a response it will call the callback function given in zb_zdo_simple_desc_req, which in this case is simple_desc_callback():

    static void simple_desc_callback(zb_bufid_t buf)
    {
        zb_uint8_t *zdp_cmd = zb_buf_begin(buf);
        zb_zdo_simple_desc_resp_t *resp = (zb_zdo_simple_desc_resp_t*)(zdp_cmd);
        zb_uint_t i;
    
        if (resp->hdr.status == ZB_ZDP_STATUS_SUCCESS) {
            // Handle the response how you want
            //resp->hdr.status
            //resp->hdr.nwk_addr
            //resp->hdr.status 
            //resp->hdr.nwk_addr
            //resp->simple_desc.endpoint, 
            //resp->simple_desc.app_profile_id,
            //resp->simple_desc.app_device_id, 
            //resp->simple_desc.app_device_version,
            //resp->simple_desc.app_input_cluster_count
            //resp->simple_desc.app_output_cluster_count
            //resp->simple_desc.app_input_cluster_count
            //resp->simple_desc.app_output_cluster_count
        }
    }

    If you have enabled Zigbee shell on your coordinator you can also use shell commands to send Simple Descriptor Req, using zdo simple_desc_req.

    Is it possible to know the real-time dynamic link status, link quality of the connected device?

    Yes, you have some different options for this.

    One is to look at the neighbor table, as this will contain estimated LQI of neighbors. You can read the neighbor table on a local device with zb_nwk_nbr_iterator_next(), or you can send a command to get the neighbor table of another device by sending a Mgmt_Lqi_Req command using zb_zdo_mgmt_lqi_req().

    Another option is to use zb_zdo_get_diag_data() to get the last known LQI and RSSI values from a specific device.

    The last option is to use the Diagnostics cluster, which you can find the API for here: Data Structures ZCL Diagnostics cluster.

    Best regards,

    Marte

Related