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

OpenThread whitelisting

Hi,

I would like to only connect certain routers in a network using whitelisting. At the moment I'm trying to set a dedicated MAC address to a router and then use this address in the whitelist. I also noticed that prior to an attemt to set an extended address, the MAC address changes after flashing the chip.

When initializing the following code in main()...

otError error = OT_ERROR_NONE;

otExtAddress setExtAddress;
setExtAddress.m8[0] = 0xfa;
setExtAddress.m8[1] = 0x21;
setExtAddress.m8[2] = 0x4f;
setExtAddress.m8[3] = 0xdf;
setExtAddress.m8[4] = 0x2e;
setExtAddress.m8[5] = 0xb9;
setExtAddress.m8[6] = 0x6c;
setExtAddress.m8[7] = 0x4a;

error = otLinkSetExtendedAddress(m_app.p_ot_instance, &setExtAddress);
NRF_LOG_INFO("error: %d\r\n", error);

I get an error = 13 which means OT_ERROR_INVALID_STATE. I'm thinking that it has something to do with the otLinkSetExtendedAddress function "only succeeding when Thread protocols are first disabled". How does one disable the Thread protocols before setting the router MAC address?

Related