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

Question about using Install Code

Hi Sir or Madam,

I tested examples\zigbee\light_control demo recently and I want to test install code function based on this example, the first step is I add install code in coordinator, then I power up coordinator and bulb(without install code function), and I found the bulb still can join the coordinator, does this means the install code function still can't work? If I want to use install code to join the netwrok that coordinator created what else I need to do? Thanks for your help!

if (zb_secur_ic_add(dut_ieee_addr1, ZB_IC_TYPE_128, install_code) != RET_OK){
}
zb_set_installcode_policy(ZB_TRUE);

Parents Reply Children
  • Subin Chen said:

    I already checked the return value of add is RET_OK. Thanks.

    /** Start Zigbee Stack. */
    zb_err_code = zboss_start_no_autostart();
    ZB_ERROR_CHECK(zb_err_code);

    if (zb_secur_ic_add(dut_ieee_addr1, ZB_IC_TYPE_128, install_code) != RET_OK){
    }
    /* Set device installcode policy */
    zb_set_installcode_policy(ZB_TRUE);

     You may mean to say that you have already checked while debugging, but this snippet doesn't check the return value of zb_secur_ic_add(), just in case you think this snippet checks, and your application is supposed to handle the exception if one occurs.

    This is because the {} brackets are empty. Just like this will print "a is equal to b":

    uint8_t a = 1;
    uint8_t b = 2;
    
    if (a == b)     //check if a == b
    {
        
    }
    
    NRF_LOG_INFO("a is equal to b");

    I'm glad to hear that you found out the issue Slight smile

    Best regards,

    Edvin

Related