5.5 Default Connection

The host MCU application establishes the default connection based on the connection profile stored in the WINC serial Flash using the m2m_wifi_default_connect API. This API does not require AP information to establish the connection.
Note: The connection profile information is automatically stored in the WINC Flash when on-demand Wi-Fi connection API is called (see Table 5-1). Saving of this connection profile is dependent on the enum tenuCredStoreOption.

The credentials such as passphrase of the AP or Enterprise certificate and other parameters like SSID, IP address, BSSID are encrypted using AES128-CBC before they are written into the serial Flash. This makes it difficult for an attacker to retrieve the sensitive information even if an attacker has physical access to the device. If there is no cached profile or if a connection cannot be established with any of the cached profile, an event of type M2M_WIFI_RESP_DEFAULT_CONNECT is delivered to the host driver indicating failure.

Upon successful default connection, the host application can read the current Wi-Fi connection status by calling m2m_wifi_get_connection_info API. The m2m_wifi_get_connection_info is an asynchronous API. The actual connection information is provided in the asynchronous event M2M_WIFI_RESP_CONN_INFO in Wi-Fi callback. The callback parameter of type tstrM2MConnInfo provides information about AP SSID, RSSI (AP received power level), security type, IP address obtained by DHCP.

Note: A connection profile is cached in the serial Flash if and only if the connection is successfully established with the target AP.
The Wi-Fi default connection operation is shown in the following figure.
Figure 5-3. Wi-Fi Default Connection