怎么确定连到局域网?
API有什么函数能用来确定是不是连接到局域网了吗?
有一个异步事件:HCI_EVNT_WLAN_UNSOL_CONNECT会传到MCU端。
//*****************************************************************************
//
//! wlan_ioctl_statusget
//!
//! @param none
//!
//! @return WLAN_STATUS_DISCONNECTED, WLAN_STATUS_SCANING,
//! STATUS_CONNECTING or WLAN_STATUS_CONNECTED
//!
//! @brief get wlan status: disconnected, scanning, connecting or connected
//
//*****************************************************************************
API内的这个函数能实现判断联网情况吗?不过
WLAN_STATUS_DISCONNECTED, WLAN_STATUS_SCANING, STATUS_CONNECTING,WLAN_STATUS_CONNECTED
都没define
可以使用这个函数的
long wlan_ioctl_statusget(void) { long ret; unsigned char *ptr; ret = EFAIL; ptr = tSLInformation.pucTxCommandBuffer; hci_command_send(HCI_CMND_WLAN_IOCTL_STATUSGET,ptr, 0); // Wait for command complete event SimpleLinkWaitEvent(HCI_CMND_WLAN_IOCTL_STATUSGET, &ret); return(ret); }
WLAN_STATUS_DISCONNECTED,
WLAN_STATUS_SCANING,
STATUS_CONNECTING,
WLAN_STATUS_CONNECTED
这四个值你们API里没define
都是什么值
0, 1, 2, 3