Other Parts Discussed in Thread: Z-STACK
SDK :Z-STACK3.0.1
How set install code?
I can use this function to generate a preconfigured TCLK from an install code as following:
sspMMOHash(NULL, 0, *installCode, bitLen, *tclk);
but I don't know how set install code , and where use bdb_setActiveCentralizedLinkKey.
ZStatus_t bdb_setActiveCentralizedLinkKey(bool useGlobal, uint8* pBuf)
{
ZStatus_t Status = ZSuccess;
uint8 extAddr[Z_EXTADDR_LEN];
if(useGlobal)
{
//Set the default key to be used in centralized networks as defaultTCLinkKey
APSME_SetDefaultKey();
}
else
{
if(pBuf != NULL)
{
#if (BDB_INSTALL_CODE_USE==BDB_INSTALL_CODE_USE_IC_CRC)
osal_memset(extAddr,0x00,Z_EXTADDR_LEN);
//Set the install code as default key
Status = bdb_addInstallCode(pBuf,extAddr);
#elif (BDB_INSTALL_CODE_USE==BDB_INSTALL_CODE_USE_KEY)
//Set the key as global default
APSME_AddTCLinkKey(pBuf,extAddr);
#else
//BDB_INSTALL_CODE_USE not supported
Status = ZFailure;
#endif
}
else
{
Status = ZInvalidParameter;
}
}
return Status;
}
#endif
BR,
Alvin