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

How to use zb_zdo_mgmt_permit_joining_req() in Zigbee 3.0 in nRF SDK for Thread & Zigbee v4.1.0

Hello Nordic support,

I would like to know how can I use the function zb_zdo_mgmt_permit_joining_req() to make the coordinator start the permit to join process forever. I understand that there is a parameter 'permit_duration' to specify the duration, which set to 0xFF, causes the joining process to occur forever. However, I would like to have an example of how to use this function. 

I already referred to the documentation and this is what I see. However, in this, I do not know what value to specify for 'param'. 

I also checked these two Nordic posts but the suggestion provided here seems to be for older version of SDK as some of the functions such as ZB_BUF_FROM_REF does not seem to be present in nRF SDK for Thread & Zigbee v4.1.0.

https://devzone.nordicsemi.com/f/nordic-q-a/52237/permanent-scan-on-a-gateway

https://devzone.nordicsemi.com/f/nordic-q-a/48671/config-zigbee-permit-join-interval-and-it-s-broadcast-address

Could you please provide an example of using zb_zdo_mgmt_permit_joining_req() function?

Regards,

Anusha

Parents
  • Hi Anusha,

    Unfortunately, you cannot set the permit duration in such a way that the network will be open indefinitely. The permit duration is set to 180 seconds in the precompiled ZBOSS stack, and it is not possible to change this value without recompiling the entire stack, which is not possible as the stack is not openly available. The best solution for this will be to open the network again after it has closed. There will be a very short time where devices cannot join the network, between closing and reopening, but this will most likely not be that noticeable to the user, since Zigbee devices will keep trying to join a network until they successfully join, and this delay will be short. You can for example use a timer to tell when the network has closed, as is done in the light coordinator example in the SDK:

    zb_err_code = ZB_SCHEDULE_APP_ALARM(steering_finished0ZB_TIME_ONE_SECOND * ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW);

    Best regards,

    Marte

  • Hi Marte,

    Thanks for your response. 

    As per this, it is not possible to change the permit join duration. If so,

    1. What is the use of the function zb_zdo_mgmt_permit_joining_req() which has join duration as a parameter?

    2. How does the macro ZB_DEFAULT_PERMIT_JOINING_DURATION in zb_config_common.h affect the join duration?

    Regards,

    Anusha

  • Hi Anusha,

    I realize now that my previous reply was somewhat misleading, so I will try to clarify better. Previously, I was mostly thinking about opening the network by starting the network steering procedure with bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING), as this is the simplest way to open the network on a coordinator in our SDK, and what is usually done. However, you can also use zb_zdo_mgmt_permit_joining_req() directly.

    The function zb_zdo_mgmt_permit_joining_req() sends a mgmt_permit_joining_req command to a remote device, to request that device to allow or disallow association (depending on whether you open or close the network). When receiving this, the device issues the NLME-PERMIT-JOINING.request primitive, and they set the permit flag depending on what the permit duration is. The network is opened and closed as part of this primitive. The mgmt_permit_joining_req command must have a destination address, but you can set the destination address to be the address of the device sending the command, so that it also receives it, and then either opens or closes the network.

    When you instead use network steering on a device, the device broadcasts the mgmt_permit_joining_req command to other devices on the network. In addition to this, if the device is a coordinator or a router it also issues the NLME-PERMIT-JOINING.request primitive. So it will issue the same primitive, but the difference is that it also sends out the command to other devices, and that it does not need to send the command to itself, as the primitive is issued as part of the network steering.

    I believe the default permit duration that cannot be changed is for network steering, but I do not think it should affect zb_zdo_mgmt_permit_joining_req(). So this was a misunderstanding on my part. However, I have not tested mgmt_permit_joining_req using different permit durations myself. If you want to use zb_zdo_mgmt_permit_joining_req() you can do so using the following:

    zb_zdo_mgmt_permit_joining_req_param_t * p_req = NULL;
    
    p_req = ZB_BUF_GET_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    p_req->dest_addr = 0;
    p_req->permit_duration = 0xff;
    p_req->tc_significance = 1;
    
    zb_zdo_mgmt_permit_joining_req(buf, permit_joining_cb);

    ZB_DEFAULT_PERMIT_JOINING_DURATION is part of the internal stack, and changing this in zb_config_common.h will not affect the join duration.

    Best regards,

    Marte

Reply
  • Hi Anusha,

    I realize now that my previous reply was somewhat misleading, so I will try to clarify better. Previously, I was mostly thinking about opening the network by starting the network steering procedure with bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING), as this is the simplest way to open the network on a coordinator in our SDK, and what is usually done. However, you can also use zb_zdo_mgmt_permit_joining_req() directly.

    The function zb_zdo_mgmt_permit_joining_req() sends a mgmt_permit_joining_req command to a remote device, to request that device to allow or disallow association (depending on whether you open or close the network). When receiving this, the device issues the NLME-PERMIT-JOINING.request primitive, and they set the permit flag depending on what the permit duration is. The network is opened and closed as part of this primitive. The mgmt_permit_joining_req command must have a destination address, but you can set the destination address to be the address of the device sending the command, so that it also receives it, and then either opens or closes the network.

    When you instead use network steering on a device, the device broadcasts the mgmt_permit_joining_req command to other devices on the network. In addition to this, if the device is a coordinator or a router it also issues the NLME-PERMIT-JOINING.request primitive. So it will issue the same primitive, but the difference is that it also sends out the command to other devices, and that it does not need to send the command to itself, as the primitive is issued as part of the network steering.

    I believe the default permit duration that cannot be changed is for network steering, but I do not think it should affect zb_zdo_mgmt_permit_joining_req(). So this was a misunderstanding on my part. However, I have not tested mgmt_permit_joining_req using different permit durations myself. If you want to use zb_zdo_mgmt_permit_joining_req() you can do so using the following:

    zb_zdo_mgmt_permit_joining_req_param_t * p_req = NULL;
    
    p_req = ZB_BUF_GET_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    p_req->dest_addr = 0;
    p_req->permit_duration = 0xff;
    p_req->tc_significance = 1;
    
    zb_zdo_mgmt_permit_joining_req(buf, permit_joining_cb);

    ZB_DEFAULT_PERMIT_JOINING_DURATION is part of the internal stack, and changing this in zb_config_common.h will not affect the join duration.

    Best regards,

    Marte

Children
No Data
Related