我现在想实现一个功能,如果终端上电周围没有网络可以加入,就进入休眠,下次上电再继续加入网络,如果没有网络还是继续休眠。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
/*********************************************************************
* @fn ZDApp_StartJoiningCycle()
*
* @brief Starts the joining cycle of a device. This will only
* continue an already started (or stopped) joining cycle.
*
* @param none
*
* @return TRUE if joining stopped, FALSE if joining or rejoining
*/
uint8 ZDApp_StartJoiningCycle( void )
{
if ( devState == DEV_INIT || devState == DEV_NWK_DISC )
{
continueJoining = TRUE;
ZDApp_NetworkInit( 0 );
return ( TRUE );
}
else
return ( FALSE );
}
/*********************************************************************
* @fn ZDApp_StopJoiningCycle()
*
* @brief Stops the joining or rejoining process of a device.
*
* @param none
*
* @return TRUE if joining stopped, FALSE if joining or rejoining
*/
uint8 ZDApp_StopJoiningCycle( void )
{
if ( devState == DEV_INIT || devState == DEV_NWK_DISC || devState == DEV_NWK_BACKOFF )
{
continueJoining = FALSE;
return ( TRUE );
}
else
return ( FALSE );
}