hi all,
i need to remove the network state in NV flash .
now ,i try to level the network and retry into new network .(as follow code)
but that can't join another network ,
that should i only leave ,not remove all network state in NV flash.
A.
i only see it at zstackCore project (ZDOInitDevice @ ZDApp.c) .
but it need HAL_KEY and HalKeyRead define ,
i find it in c:\ti\simplelink\zstack_home_1_02_02a_44539\Components\hal\target\CC2650\hal_key.c
in HalKeyRead function ,that use
if(!(GPIOPinRead(BTN_PORT_R, HAL_BTN_R) & HAL_BTN_R)) to read GPIO status ,but it should be CC2531/8 not CC2650
B.i see the (Z-Stack TI-RTOS API Revision 42527 ) no think about it.
it is Zstackapi_sysConfigWriteReq () to do it ?how to do it?(remove network state)
static void SensorTagApp_resetNVErase(void)
{
zstack_zdoMgmtLeaveReq_t leaveReq;
zstack_sysNwkInfoReadRsp_t *nwkInfo;
nwkInfo = zclport_getDeviceInfo(zswEntity);
memcpy(leaveReq.deviceAddress, nwkInfo->ieeeAddr,
EXTADDR_LEN);
leaveReq.nwkAddr = nwkInfo->nwkAddr;
leaveReq.options.rejoin = false;
leaveReq.options.removeChildren = true;
Zstackapi_ZdoMgmtLeaveReq( zswEntity, &leaveReq);
zstack_sysResetReq_t restReq;
restReq.type = zstack_ResetTypes_DEVICE;
restReq.newNwkState = true;
(void)Zstackapi_sysResetReq(zswEntity, &restReq);
zstack_devStartReq_t startReq = {0};
// Start the ZStack Thread
startReq.startDelay = 0;
(void)Zstackapi_DevStartReq(zswEntity, &startReq);
}
ps:
Ti zigbee SDK :
zstack_home_1_02_02a_44539
define symbol:
ZSTACK_MANUAL_START
ZCL_READ
ZCL_WRITE
ZCL_BASIC
ZCL_ON_OFF
ZCL_IDENTIFY
xZCL_EZMODE
xZCL_GROUPS
xZCL_SCENES
ZCL_STANDALONE
ZG_SECURE_ENABLED
ewarm
USE_ICALL
HEAPMGR_SIZE=4096
ICALL_HOOK_ABORT_FUNC=halAssertHandler
xdc_runtime_Log_DISABLE_ALL
xdc_runtime_Assert_DISABLE_ALL
MODULE_CC26XX_5X5
POWER_SAVING
Zcode :
MODULE_CC26XX_5X5
xZDO_API_ADVANCED
ZDO_API_BASIC
CC26XX
FLASH_ROM_BUILD
USE_ICALL
TC_LINKKEY_JOIN
HAL_ASSERT_SPIN
xHALNODEBUG
xDEBUG
xDEBUG_SW_TRACE
xDBG_ENABLE
OAD_KEEP_NV_PAGES
NV_RESTORE
NV_INIT
FEATURE_MAC_SECURITY
FEATURE_GREEN_POWER
FEATURE_ENHANCED_BEACON
xHOLD_AUTO_START
ewarm
NEAR_FUNC=
DATA=