Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Synchronous initialization functions for the WILC driver.

This function initializes the driver by, registering the call back function for M2M_WIFI layer (also the call back function for monitoring mode if defined),
initializing the host interface layer and the bus interfaces.
Wi-Fi callback registering is essential to allow the handling of the events received, in response to the asynchronous wi-fi operations.
Following are the possible wi-fi events that are expected to be received through the call back function(provided by the application) to the M2M_WIFI layer are :
M2M_WIFI_RESP_CON_STATE_CHANGED
M2M_WIFI_RESP_CONN_INFO
M2M_WIFI_RES_WPS
M2M_WIFI_RESP_SCAN_DONE
M2M_WIFI_RESP_SCAN_RESULT
M2M_WIFI_RESP_CURRENT_RSSI
M2M_WIFI_RESP_DEFAULT_CONNECT
M2M_WIFI_RESP_ETHERNET_RX_PACKET Example:
In case Monitoring mode is used:
M2M_WIFI_RESP_WIFI_RX_PACKET

Any application using the WILC driver must call this function at the start of its main function.

Functions

NMI_API sint8 m2m_wifi_init (tstrWifiInitParam *pWifiInitParam)
 

NMI_API sint8 m2m_wifi_init ( tstrWifiInitParam param)
Parameters
[in]pWifiInitParamThis is a pointer to the tstrWifiInitParam structure which holds the pointer to the application WIFI layer call back function, monitoring mode call back and tstrEthInitParam strucutre.
Precondition
Prior to this function call, application users must provide a call back function responsible for receiving all the wi-fi events that are received on the M2M_WIFI layer.
Warning
Failure to successfully complete function indicates that the driver couldn't be initialized and a fatal error will prevent the application from proceeding.
See Also
m2m_wifi_deinit tenuM2mStaCmd
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

References tstrEthInitParam::au8ethRcvBuf, gpfAppEthCb, gpfAppMonCb, gpfAppWifiCb, gpu8ethRcvBuf, gu16ethRcvBufSize, gu8scanInProgress, hif_init(), hif_register_cb(), M2M_REQ_GRP_WIFI, M2M_SUCCESS, m2m_wifi_cb(), nm_drv_deinit(), nm_drv_init(), NULL, tstrEthInitParam::pfAppEthCb, tstrWifiInitParam::pfAppMonCb, tstrWifiInitParam::pfAppWifiCb, tstrHifinitParam::pu8RcvBuff, tstrWifiInitParam::strEthInitParam, strHifInitParam, tstrEthInitParam::u16ethRcvBufSize, and tstrHifinitParam::u32RcvBuffSize.

Referenced by os_m2m_wifi_init_imp().