设置PANID或通道后能否不重启设备
我现在把PANID或通道切换后,要重启设备才能生效,能否不重启设备?
你是通过什么方式修改PANID和信道的
通过修改PANID和信道变量的值,然后存储到NV,下面是相关代码:
if((xChanel != zgDefaultChannelList)||(xPan_ID != zgConfigPANID))
{
zgConfigPANID = xPan_ID;
zgDefaultChannelList = xChanel;
osal_nv_item_init(ZCD_NV_PANID, sizeof(zgConfigPANID), &zgConfigPANID);
osal_nv_write(ZCD_NV_PANID, 0, sizeof( zgConfigPANID ), &zgConfigPANID);
osal_nv_item_init(ZCD_NV_CHANLIST, sizeof(zgDefaultChannelList), &zgDefaultChannelList);
osal_nv_write(ZCD_NV_CHANLIST, 0, sizeof( zgDefaultChannelList ), &zgDefaultChannelList);
osal_start_timerEx( GenericApp_TaskID, QUBLIC_SW_RESET_EVEN ,1000);
//zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );
}
}
如果是协调器那就可以直接这么改了,不需要重新启动
// ret = NLME_NetworkFormationRequest( zgConfigPANID, zgApsUseExtendedPANID, runtimeChannel, //fsm ,屏蔽,0719
// zgDefaultStartingScanDuration, beaconOrder, //fsm ,屏蔽,0719
// superframeOrder, false ); //fsm ,屏蔽,0719
ret = NLME_NetworkFormationRequest( set_panid, zgApsUseExtendedPANID,set_channel, //fsm ,添加,0719
zgDefaultStartingScanDuration, beaconOrder, //fsm ,添加,0719
superframeOrder, false ); //fsm ,添加,0719
您好!如果是路由节点和终端节点需要调用哪些函数?我现在直接调用osalInitTasks();多设置几次PANID或通道后会加入不了网络