cc3200代码中一些问题
关于下面这些handler函数,历程中在哪里调用?
比如:
找不到代码中有调用他的地方,希望知道的人指教一下~~
关于SimpleLinkWlanEventHandler()函数的目的是,当CC3200的NWP内核连接到WLan后,会通过内部SPI的总线通知CC3200的M4内核,进行Callback函数的回调处理,这个Handler函数就是其中之一的回调函数
//*****************************************************************************
// SimpleLink Asynchronous Event Handlers -- Start
//*****************************************************************************
//*****************************************************************************
//
//! \brief The Function Handles WLAN Events
//!
//! \param[in] pWlanEvent - Pointer to WLAN Event Info
//!
//! \return None
//!
//*****************************************************************************
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
{
if(pWlanEvent == NULL)
{
UART_PRINT("Null pointer\n\r");
LOOP_FOREVER();
}
switch(pWlanEvent->Event)
{
case SL_WLAN_CONNECT_EVENT:
{
SET_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
//
// Information about the connected AP (like name, MAC etc) will be
// available in 'slWlanConnectAsyncResponse_t'
// Applications can use it if required
//
// slWlanConnectAsyncResponse_t *pEventData = NULL;
// pEventData = &pWlanEvent->EventData.STAandP2PModeWlanConnected;
//
// Copy new connection SSID and BSSID to global parameters
memcpy(g_ucConnectionSSID,pWlanEvent->EventData.
STAandP2PModeWlanConnected.ssid_name,
pWlanEvent->EventData.STAandP2PModeWlanConnected.ssid_len);
memcpy(g_ucConnectionBSSID,
pWlanEvent->EventData.STAandP2PModeWlanConnected.bssid,
SL_BSSID_LENGTH);
UART_PRINT("[WLAN EVENT] STA Connected to the AP: %s , "
"BSSID: %x:%x:%x:%x:%x:%x\n\r",
g_ucConnectionSSID,g_ucConnectionBSSID[0],
g_ucConnectionBSSID[1],g_ucConnectionBSSID[2],
g_ucConnectionBSSID[3],g_ucConnectionBSSID[4],
g_ucConnectionBSSID[5]);
}
break;
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;
default:
{
UART_PRINT("[WLAN EVENT] Unexpected event [0x%x]\n\r",
pWlanEvent->Event);
}
break;
}
}