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

Lock and restart Zigbee Stack

Hello!

I'm using the nRF 52840 module for Zigbee applications.
I am implementing a Zigbee router and I need the time-limited commissioning on the device, such as the creation of a Zigbee network by a Coordinator. At the moment I can't find any API to do this. Is there a way to lock and restart the Zigbee stack without necessarily having to reset the device?

Thank you,

Raffaela

Parents
  • Hi Raffaela.

    At the moment, there is not a API for this. You could try to implement this yourself by sending two seperate ZDO requests.

    Best regards,

    Andreas

  • Hi Andreas,

    Thank you for your answer. Can you give me an example?

    Best regards,

    Raffaela

  • Hi Raffaela.

    Sorry for the late reply, I'm home with the flu.

    I don't really have an example for this, you could try something like this:

    void lock_network_cb(zb_uint8_t param)
    {
      NRF_LOG_INFO("Network is locked");
      zb_free_buf(ZB_BUF_FROM_REF(param));
    }
    
    void lock_network(zb_uint8_t param)
    {
      zb_buf_t *buf = ZB_BUF_FROM_REF(param);
    
      if (buf->u.hdr.status == 0)
      {
        zb_zdo_mgmt_permit_joining_req_param_t *req_param = ZB_GET_BUF_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    
        NRF_LOG_INFO("Device STARTED OK");
    
        /* ask coordinator not to accept more childs */
        req_param->dest_addr = 0;
        req_param->permit_duration = 0;
        req_param->tc_significance = 1;
    
        zb_zdo_mgmt_permit_joining_req(param, &permit_joining_cb);
      }
      else
      {
        NRF_LOG_INFO("Device started FAILED status %d", (int)buf->u.hdr.status);
        zb_free_buf(buf);
      }
    }

    And then start the network again by bdb_start_top_level_commissioning().

    Note,I have not tested this since I'm not in the office at the moment.

    Best regards,

    Andreas

Reply
  • Hi Raffaela.

    Sorry for the late reply, I'm home with the flu.

    I don't really have an example for this, you could try something like this:

    void lock_network_cb(zb_uint8_t param)
    {
      NRF_LOG_INFO("Network is locked");
      zb_free_buf(ZB_BUF_FROM_REF(param));
    }
    
    void lock_network(zb_uint8_t param)
    {
      zb_buf_t *buf = ZB_BUF_FROM_REF(param);
    
      if (buf->u.hdr.status == 0)
      {
        zb_zdo_mgmt_permit_joining_req_param_t *req_param = ZB_GET_BUF_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    
        NRF_LOG_INFO("Device STARTED OK");
    
        /* ask coordinator not to accept more childs */
        req_param->dest_addr = 0;
        req_param->permit_duration = 0;
        req_param->tc_significance = 1;
    
        zb_zdo_mgmt_permit_joining_req(param, &permit_joining_cb);
      }
      else
      {
        NRF_LOG_INFO("Device started FAILED status %d", (int)buf->u.hdr.status);
        zb_free_buf(buf);
      }
    }

    And then start the network again by bdb_start_top_level_commissioning().

    Note,I have not tested this since I'm not in the office at the moment.

    Best regards,

    Andreas

Children
Related