TI中文支持网
TI专业的中文技术问题搜集分享网站

3200不运行系统,怎么样自动检测到断网事件

TI工程师:

          你们好,想请问下3200不运行系统,怎么样自动检测到断网事件,联网事件可以检测的到,但是断网事件无法检测到;没有采用smartconfig联网配置,用的是flash读取密码联网;

那么:(1)是否类似联网事件要清除一个标志位;

(2)是否需要调用某一个专用函数

 

Yonghua Pan:

CC3200断网的时候会返回一个DISCONNECT的时间,请问你有收到这个世界吗?

chao D:

回复 Yonghua Pan:

检测不到这个事件,这个事件是需要通过调用哪个函数来注册吗?

Terry Han:

回复 chao D:

会产生 SL_WLAN_DISCONNECT_EVENT事件:

void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent){ if(pWlanEvent == NULL) { UART_PRINT("Null pointer\n\r"); LOOP_FOREVER(); } switch(pWlanEvent->Event) {

case SL_WLAN_DISCONNECT_EVENT: { slWlanConnectAsyncResponse_t* pEventData = NULL;

CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION); CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);

pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;

// If the user has initiated 'Disconnect' request, //'reason_code' is SL_USER_INITIATED_DISCONNECTION if(SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code) { UART_PRINT("[WLAN EVENT]Device disconnected from the AP: %s, " "BSSID: %x:%x:%x:%x:%x:%x on application's " "request \n\r", g_ucConnectionSSID,g_ucConnectionBSSID[0], g_ucConnectionBSSID[1],g_ucConnectionBSSID[2], g_ucConnectionBSSID[3],g_ucConnectionBSSID[4], g_ucConnectionBSSID[5]); } else { UART_PRINT("[WLAN ERROR]Device disconnected from the AP AP: %s, " "BSSID: %x:%x:%x:%x:%x:%x on an ERROR..!! \n\r", g_ucConnectionSSID,g_ucConnectionBSSID[0], g_ucConnectionBSSID[1],g_ucConnectionBSSID[2], g_ucConnectionBSSID[3],g_ucConnectionBSSID[4], g_ucConnectionBSSID[5]); } memset(g_ucConnectionSSID,0,sizeof(g_ucConnectionSSID)); memset(g_ucConnectionBSSID,0,sizeof(g_ucConnectionBSSID)); } break;

kqian0327:

你好,

跑TI的例程。

打开你的串口,波特率设置为115200..

连上一个AP,跑起来,然后你再把AP关掉,你看看UART都打印些啥了~

赞(0)
未经允许不得转载:TI中文支持网 » 3200不运行系统,怎么样自动检测到断网事件
分享到: 更多 (0)