CC3200在ap模式下如何检测wifi链接已断开
时间:10-02
整理:3721RD
点击:
能不能用IS_IP_LEASED()这个函数判断呢?
CC3200有相关的协议会去检测连接情况。当AP掉电后,CC3200会提示出链接断开。
你可以收到下面这个事件吗?
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pSlWlanEvent)
{
switch(pSlWlanEvent->Event)
{
......................................
case SL_WLAN_STA_DISCONNECTED_EVENT:
{
// when client disconnects from device (AP)
CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_LEASED);
//
// Information about the connected client (like SSID, MAC etc) will
// be available in 'slPeerInfoAsyncResponse_t' - Applications
// can use it if required
//
// slPeerInfoAsyncResponse_t *pEventData = NULL;
// pEventData = &pSlWlanEvent->EventData.APModestaDisconnected;
//
}
break;