WINC1500 IoT Software APIs: m2m_wifi_connect

WINC1500 IoT Software API

WINC1500 IoT Software APIs  19.5.2
WINC Software API Reference Manual
m2m_wifi_connect

Functions

NMI_API sint8 m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch)
 
NMI_API sint8 m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8SaveCred)
 

Detailed Description

Asynchronous wi-fi connection function to a specific AP. Prior to a successful connection, the application must define the SSID of the AP, the security type, the authentication information parameters and the channel number to which the connection will be established. The connection status is known when a response of M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in tenuM2mConnState, successful connection is defined by M2M_WIFI_CONNECTED

The only difference between this function and m2m_wifi_default_connect, is the connection parameters. Connection using this function is expected to be made to a specific AP and to a specified channel.

Asynchronous wi-fi connection function to a specific AP. Prior to a successful connection, the application developers must know the SSID of the AP, the security type, the authentication information parameters and the channel number to which the connection will be established.this API allows the user to choose whether to The connection status is known when a response of M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in tenuM2mConnState, successful connection is defined by M2M_WIFI_CONNECTED The only difference between this function and m2m_wifi_connect, is the option to save the acess point info ( SSID, password...etc) or not. Connection using this function is expected to be made to a specific AP and to a specified channel.

Function Documentation

◆ m2m_wifi_connect()

NMI_API sint8 m2m_wifi_connect ( char *  pcSsid,
uint8  u8SsidLen,
uint8  u8SecType,
void *  pvAuthInfo,
uint16  u16Ch 
)
Parameters
[in]pcSsidA buffer holding the SSID corresponding to the requested AP.
[in]u8SsidLenLength of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL.
[in]u8SecTypeWi-Fi security type security for the network. It can be one of the following types: -M2M_WIFI_SEC_OPEN -M2M_WIFI_SEC_WEP -M2M_WIFI_SEC_WPA_PSK -M2M_WIFI_SEC_802_1X A value outside these possible values will result in a negative return error M2M_ERR_FAIL.
[in]pvAuthInfoAuthentication parameters required for completing the connection. It is type is based on the Security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure.
[in]u16ChWi-Fi channel number as defined in tenuM2mScanCh enumeration. Channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL(-12). Except if the value is M2M_WIFI_CH_ALL(255), since this indicates that the firmware should scan all channels to find the SSID requested to connect to. Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.
Precondition
Prior to a successful connection request, the Wi-Fi driver must have been successfully initialized through the call of the function
See also
tuniM2MWifiAuth tstr1xAuthCredentials tstrM2mWifiWepParams
Warning
-This function must be called in station mode only. -Successful completion of this function does not guarantee success of the WIFI connection, and a negative return value indicates only locally-detected errors.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

◆ m2m_wifi_connect_sc()

NMI_API sint8 m2m_wifi_connect_sc ( char *  pcSsid,
uint8  u8SsidLen,
uint8  u8SecType,
void *  pvAuthInfo,
uint16  u16Ch,
uint8  u8SaveCred 
)
Parameters
[in]pcSsidA buffer holding the SSID corresponding to the requested AP.
[in]u8SsidLenLength of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL.
[in]u8SecTypeWi-Fi security type security for the network. It can be one of the following types: -M2M_WIFI_SEC_OPEN -M2M_WIFI_SEC_WEP -M2M_WIFI_SEC_WPA_PSK -M2M_WIFI_SEC_802_1X A value outside these possible values will result in a negative return error M2M_ERR_FAIL.
[in]pvAuthInfoAuthentication parameters required for completing the connection. It is type is based on the Security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure.
[in]u16ChWi-Fi channel number as defined in tenuM2mScanCh enumeration. Channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL(-12). Except if the value is M2M_WIFI_CH_ALL(255), since this indicates that the firmware should scan all channels to find the SSID requested to connect to. Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.
[in]u8NoSaveCredOption to store the acess point SSID and password into the WINC flash memory or not.
Precondition
Prior to a successful connection request, the wi-fi driver must have been successfully initialized through the call of the function
See also
tuniM2MWifiAuth tstr1xAuthCredentials tstrM2mWifiWepParams
Warning
-This function must be called in station mode only. -Successful completion of this function does not guarantee success of the WIFI connection, and a negative return value indicates only locally-detected errors.
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Generated on Thu Jan 26 2017 22:15:21 for WINC1500 IoT Software APIs by   doxygen 1.8.13