Here are listed all the functions that implement the Wifi Connection APIs.
Functions | |
sint8 | m2m_wifi_1x_get_option (tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen) |
API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication. More... | |
sint8 | m2m_wifi_1x_set_option (tenu1xOption enuOptionName, const void *pOptionValue, size_t OptionLen) |
API to set (write) options relating to Wi-Fi connection using WPA(2) Enterprise authentication. More... | |
sint8 | m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch) |
Legacy asynchronous API to request connection to a specified access point. More... | |
sint8 | m2m_wifi_connect_1x_mschap2 (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xMschap2 *pstrAuth1xMschap2) |
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials. More... | |
sint8 | m2m_wifi_connect_1x_tls (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xTls *pstrAuth1xTls) |
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials. More... | |
sint8 | m2m_wifi_connect_open (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId) |
Asynchronous API to connect to an access point using open authentication. More... | |
sint8 | m2m_wifi_connect_psk (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthPsk *pstrAuthPsk) |
Asynchronous API to connect to an access point using WPA(2) PSK authentication. More... | |
sint8 | m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8NoSaveCred) |
Legacy asynchronous API to request connection to a specific AP with the option to save credentials in Flash. More... | |
sint8 | m2m_wifi_connect_wep (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthWep *pstrAuthWep) |
Asynchronous API to connect to an access point using WEP authentication. More... | |
sint8 | m2m_wifi_default_connect (void) |
Asynchronous API that attempts to reconnect to the last-associated access point. More... | |
sint8 | m2m_wifi_delete_sc (char *pcSsid, uint8 u8SsidLen) |
Asynchronous API that deletes connection credentials (PSK, WEP key, 802.1X password) from WINC flash. Either deletes all credentials, or for a specific SSID. More... | |
sint8 | m2m_wifi_disconnect (void) |
Synchronous API to request disconnection from a network. More... | |
sint8 | m2m_wifi_enable_dhcp (uint8 u8DhcpEn) |
Asynchronous function to control the DHCP client functionality within the WINC. More... | |
sint8 | m2m_wifi_get_connection_info (void) |
Asynchronous API for retrieving the WINC connection status. More... | |
sint8 | m2m_wifi_req_curr_rssi (void) |
Request the current RSSI for the current connected AP, the response received in wifi_cb M2M_WIFI_RESP_CURRENT_RSSI. More... | |
sint8 | m2m_wifi_request_dhcp_client (void) |
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC. More... | |
sint8 | m2m_wifi_request_dhcp_server (uint8 *addr) |
Legacy (deprecated) asynchronous function to start a DHCP client on the WINC. More... | |
sint8 | m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf) |
Asynchronous API to manually assign a (static) IP address to the WINC. More... | |
sint8 m2m_wifi_1x_get_option | ( | tenu1xOption | enuOptionName, |
void * | pOptionValue, | ||
size_t * | pOptionLen | ||
) |
API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.
The following options can be read:\n @ref WIFI_1X_BYPASS_SERVER_AUTH\n @ref WIFI_1X_TIME_VERIF_MODE\n @ref WIFI_1X_SESSION_CACHING\n @ref WIFI_1X_SPECIFIC_ROOTCERT\n
[in] | enuOptionName | The option to get. |
[out] | pOptionValue | Pointer to a buffer to be filled with the value being read. The buffer must be at least as long as the length in pOptionLen |
[in,out] | pOptionLen | Pointer to a length. When calling the function, this length must be the length of the buffer available for reading the option value. When the function returns, this length is the length of the data that has been populated by the function. |
References gau81xRootSha1, gu321xTlsHsFlags, M2M_ERR_INVALID_ARG, m2m_memcpy(), M2M_SUCCESS, NULL, TLS_CERT_EXP_CHECK_DISABLE, TLS_CERT_EXP_CHECK_EN_IF_SYS_TIME, TLS_CERT_EXP_CHECK_ENABLE, WIFI_1X_BYPASS_SERVER_AUTH, WIFI_1X_SESSION_CACHING, WIFI_1X_SPECIFIC_ROOTCERT, WIFI_1X_TIME_VERIF_MODE, WIFI_1X_TLS_HS_FLAGS_PEER_AUTH, WIFI_1X_TLS_HS_FLAGS_PEER_CERTTIMECHECK, WIFI_1X_TLS_HS_FLAGS_REQUIRE_TIME, WIFI_1X_TLS_HS_FLAGS_SESSION_CACHING, and WIFI_1X_TLS_HS_FLAGS_SPECIFY_ROOTCERT.
sint8 m2m_wifi_1x_set_option | ( | tenu1xOption | enuOptionName, |
const void * | pOptionValue, | ||
size_t | OptionLen | ||
) |
API to set (write) options relating to Wi-Fi connection using WPA(2) Enterprise authentication.
The following options can be set:\n @ref WIFI_1X_BYPASS_SERVER_AUTH\n @ref WIFI_1X_TIME_VERIF_MODE\n @ref WIFI_1X_SESSION_CACHING\n @ref WIFI_1X_SPECIFIC_ROOTCERT\n The setting applies to all subsequent connection attempts via @ref m2m_wifi_connect_1x_mschap2 or @ref m2m_wifi_connect_1x_tls.\n Connection attempts via @ref m2m_wifi_default_connect use the settings which were in place at the time of the original connection.
[in] | enuOptionName | The option to set. |
[in] | pOptionValue | Pointer to a buffer containing the value to set. The buffer must be at least as long as OptionLen. If OptionLen is 0, then pOptionValue may be NULL. |
[in] | OptionLen | The length of the option value being set. |
References gau81xRootSha1, gu321xTlsHsFlags, M2M_ERR_INVALID_ARG, m2m_memcpy(), m2m_memset(), M2M_SUCCESS, NULL, TLS_CERT_EXP_CHECK_DISABLE, TLS_CERT_EXP_CHECK_EN_IF_SYS_TIME, TLS_CERT_EXP_CHECK_ENABLE, WIFI_1X_BYPASS_SERVER_AUTH, WIFI_1X_SESSION_CACHING, WIFI_1X_SPECIFIC_ROOTCERT, WIFI_1X_TIME_VERIF_MODE, WIFI_1X_TLS_HS_FLAGS_PEER_AUTH, WIFI_1X_TLS_HS_FLAGS_PEER_CERTTIMECHECK, WIFI_1X_TLS_HS_FLAGS_REQUIRE_TIME, WIFI_1X_TLS_HS_FLAGS_SESSION_CACHING, and WIFI_1X_TLS_HS_FLAGS_SPECIFY_ROOTCERT.
NMI_API sint8 m2m_wifi_connect | ( | char * | pcSsid, |
uint8 | u8SsidLen, | ||
uint8 | u8SecType, | ||
void * | pvAuthInfo, | ||
uint16 | u16Ch | ||
) |
Legacy asynchronous API to request connection to a specified access point.
This API is maintained for purposes of compatibility with legacy applications. It is implemented as a wrapper for the following new APIs: @ref m2m_wifi_connect_open @ref m2m_wifi_connect_wep @ref m2m_wifi_connect_psk @ref m2m_wifi_connect_1x_mschap2 @ref m2m_wifi_connect_1x_tls These new APIs allow more flexibility and it is recommended that applications use them instead.
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. SSID must not contain '\0'. |
[in] | u8SsidLen | Length of the given SSID (not including any NULL termination). A length greater than or equal to M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL. |
[in] | u8SecType | Wi-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] | pvAuthInfo | Authentication parameters required for completing the connection. Its 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 indicating connection failure. |
[in] | u16Ch | Wi-Fi channel number as defined in tenuM2mScanCh enumeration. Specifying a channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL, unless the value is M2M_WIFI_CH_ALL, since this indicates that the firmware should scan all channels to find the SSID specified in parameter pcSsid. |
Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.
Additionally:
References m2m_wifi_connect_sc().
Referenced by wifi_ap_connect().
sint8 m2m_wifi_connect_1x_mschap2 | ( | tenuCredStoreOption | enuCredStoreOption, |
tstrNetworkId * | pstrNetworkId, | ||
tstrAuth1xMschap2 * | pstrAuth1xMschap2 | ||
) |
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the Enterprise MS-CHAP-V2 credentials provided in pstrAuth1xMschap2. On successful connection, the connection details may be saved in WINC flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event @ref M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function tpfAppWifiCb provided during initialization @ref m2m_wifi_init. Possible results indicated by the response event are: - @ref M2M_WIFI_DISCONNECTED if the connection attempt failed. - @ref M2M_WIFI_CONNECTED if the connection attempt succeeded.
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuth1xMschap2) are stored in WINC flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
[in] | pstrAuth1xMschap2 | Structure specifying the MS-CHAP-V2 credentials. |
References tstrM2mWifi1xHdr::au81xAuthDetails, tstrM2mWifi1xHdr::au8TlsSpecificRootNameSha1, tstrAuth1xMschap2::bPrependDomain, tstrAuth1xMschap2::bUnencryptedUserName, gau81xRootSha1, gu321xTlsHsFlags, hif_send(), M2M_802_1X_MSCHAP2_FLAG, M2M_802_1X_PREPEND_DOMAIN_FLAG, M2M_802_1X_UNENCRYPTED_USERNAME_FLAG, M2M_AUTH_1X_PASSWORD_LEN_MAX, M2M_AUTH_1X_USER_LEN_MAX, M2M_ERR_INVALID_ARG, M2M_ERR_MEM_ALLOC, m2m_memcpy(), m2m_memset(), M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, M2M_WIFI_SEC_802_1X, NULL, tstrAuth1xMschap2::pu8Domain, tstrAuth1xMschap2::pu8Password, tstrAuth1xMschap2::pu8UserName, tstrAuth1xMschap2::u16DomainLen, tstrAuth1xMschap2::u16PasswordLen, tstrM2mWifi1xHdr::u16PrivateKeyLength, tstrM2mWifi1xHdr::u16PrivateKeyOffset, tstrAuth1xMschap2::u16UserNameLen, tstrM2mWifi1xHdr::u32TlsHsFlags, tstrM2mWifi1xHdr::u8DomainLength, tstrM2mWifi1xHdr::u8Flags, tstrM2mWifi1xHdr::u8HdrLength, and tstrM2mWifi1xHdr::u8UserNameLength.
Referenced by wifi_ap_connect().
sint8 m2m_wifi_connect_1x_tls | ( | tenuCredStoreOption | enuCredStoreOption, |
tstrNetworkId * | pstrNetworkId, | ||
tstrAuth1xTls * | pstrAuth1xTls | ||
) |
Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the Enterprise TLS credentials provided in pstrAuth1xTls. On successful connection, the connection details may be saved in WINC flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event @ref M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function @ref tpfAppWifiCb provided during initialization @ref m2m_wifi_init. Possible results indicated by the response event are: - @ref M2M_WIFI_DISCONNECTED if the connection attempt failed. - @ref M2M_WIFI_CONNECTED if the connection attempt succeeded.
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuth1xTls) are stored in WINC flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
[in] | pstrAuth1xTls | Structure specifying the EAP-TLS credentials. |
References tstrM2mWifi1xHdr::au81xAuthDetails, tstrM2mWifi1xHdr::au8TlsSpecificRootNameSha1, tstrAuth1xTls::bPrependDomain, tstrAuth1xTls::bUnencryptedUserName, gau81xRootSha1, gu321xTlsHsFlags, hif_send(), M2M_802_1X_PREPEND_DOMAIN_FLAG, M2M_802_1X_TLS_CLIENT_CERTIFICATE, M2M_802_1X_TLS_FLAG, M2M_802_1X_UNENCRYPTED_USERNAME_FLAG, M2M_AUTH_1X_CERT_LEN_MAX, M2M_AUTH_1X_PRIVATEKEY_LEN_MAX, M2M_AUTH_1X_USER_LEN_MAX, M2M_ERR_INVALID_ARG, M2M_ERR_MEM_ALLOC, m2m_memcpy(), m2m_memset(), M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_IND_CONN_PARAM, M2M_WIFI_REQ_CONN, M2M_WIFI_SEC_802_1X, NULL, tstrAuth1xTls::pu8Certificate, tstrAuth1xTls::pu8Domain, tstrAuth1xTls::pu8PrivateKey_Exp, tstrAuth1xTls::pu8PrivateKey_Mod, tstrAuth1xTls::pu8UserName, tstrAuth1xTls::u16CertificateLen, tstrM2mWifi1xHdr::u16CertificateLength, tstrM2mWifi1xHdr::u16CertificateOffset, tstrAuth1xTls::u16DomainLen, tstrM2mWifiAuthInfoHdr::u16InfoLen, tstrM2mWifiAuthInfoHdr::u16InfoPos, tstrAuth1xTls::u16PrivateKeyLen, tstrM2mWifi1xHdr::u16PrivateKeyLength, tstrM2mWifi1xHdr::u16PrivateKeyOffset, tstrAuth1xTls::u16UserNameLen, tstrM2mWifi1xHdr::u32TlsHsFlags, tstrM2mWifi1xHdr::u8DomainLength, tstrM2mWifi1xHdr::u8Flags, tstrM2mWifi1xHdr::u8HdrLength, tstrM2mWifiAuthInfoHdr::u8Type, and tstrM2mWifi1xHdr::u8UserNameLength.
Referenced by wifi_ap_connect().
sint8 m2m_wifi_connect_open | ( | tenuCredStoreOption | enuCredStoreOption, |
tstrNetworkId * | pstrNetworkId | ||
) |
Asynchronous API to connect to an access point using open authentication.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with open authentication. On successful connection, the connection details may be saved in WINC flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event @ref M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function @ref tpfAppWifiCb provided during initialization @ref m2m_wifi_init. Possible results indicated by the response event are: - @ref M2M_WIFI_DISCONNECTED if the connection attempt failed. - @ref M2M_WIFI_CONNECTED if the connection attempt succeeded.
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId) are stored in WINC flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
References hif_send(), legacy_connect_prepare_msg(), M2M_ERR_INVALID_ARG, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, M2M_WIFI_REQ_CONNECT, M2M_WIFI_SEC_OPEN, and NULL.
Referenced by m2m_wifi_connect_sc().
sint8 m2m_wifi_connect_psk | ( | tenuCredStoreOption | enuCredStoreOption, |
tstrNetworkId * | pstrNetworkId, | ||
tstrAuthPsk * | pstrAuthPsk | ||
) |
Asynchronous API to connect to an access point using WPA(2) PSK authentication.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the PSK passphrase provided in pstrAuthPsk. On successful connection, the connection details may be saved in WINC flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event @ref M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function @ref tpfAppWifiCb provided during initialization @ref m2m_wifi_init. Possible results indicated by the response event are: - @ref M2M_WIFI_DISCONNECTED if the connection attempt failed. - @ref M2M_WIFI_CONNECTED if the connection attempt succeeded.
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuthPsk) are stored in WINC flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
[in] | pstrAuthPsk | Structure specifying the Passphrase/PSK. |
References tstrM2mWifiPsk::au8Passphrase, tuniM2MWifiAuthLegacy_1_2::au8PSK, hexstr_2_bytes(), hif_send(), legacy_connect_prepare_msg(), M2M_ERR_INVALID_ARG, M2M_ERR_MEM_ALLOC, M2M_MAX_PSK_LEN, m2m_memcpy(), m2m_memset(), M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, M2M_WIFI_REQ_CONNECT, M2M_WIFI_SEC_WPA_PSK, NULL, tstrAuthPsk::pu8Passphrase, tstrAuthPsk::pu8Psk, tstrM2mWifiConnectLegacy_1_2::strSec, tstrAuthPsk::u8PassphraseLen, tstrM2mWifiPsk::u8PassphraseLen, and tstrM2MWifiSecInfoLegacy_1_2::uniAuth.
Referenced by m2m_wifi_connect_sc().
NMI_API sint8 m2m_wifi_connect_sc | ( | char * | pcSsid, |
uint8 | u8SsidLen, | ||
uint8 | u8SecType, | ||
void * | pvAuthInfo, | ||
uint16 | u16Ch, | ||
uint8 | u8SaveCred | ||
) |
Legacy asynchronous API to request connection to a specific AP with the option to save credentials in Flash.
This API is maintained for purposes of compatibility with legacy applications. It is implemented as a wrapper for the following new APIs: @ref m2m_wifi_connect_open @ref m2m_wifi_connect_wep @ref m2m_wifi_connect_psk @ref m2m_wifi_connect_1x_mschap2 @ref m2m_wifi_connect_1x_tls These new APIs allow more flexibility and it is recommended that applications use them instead.
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. SSID must not contain '\0'. |
[in] | u8SsidLen | Length of the given SSID (not including any NULL termination). A length greater than or equal to M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL. |
[in] | u8SecType | Wi-Fi security type security for the network (see tenuM2mSecType). 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] | pvAuthInfo | Authentication parameters required for completing the connection. Its 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 indicating connection failure. |
[in] | u16Ch | Wi-Fi channel number as defined in tenuM2mScanCh enumeration. Specification of a channel number greater than M2M_WIFI_CH_14 returns a negative error M2M_ERR_FAIL unless the value is M2M_WIFI_CH_ALL. A channel number of M2M_WIFI_CH_ALL indicates that the firmware should scan all channels to find the SSID specified in parameter pcSsid. |
Failure to find the connection match will return a negative error M2M_DEFAULT_CONN_SCAN_MISMATCH.
[in] | u8SaveCred | Option to store the access point SSID and password into the WINC flash memory or not. |
Additionally:
References tstrM2mWifiWepParams::au8WepKey, M2M_ERR_INVALID_ARG, M2M_MAX_PSK_LEN, M2M_MAX_SSID_LEN, m2m_strlen(), m2m_wifi_connect_open(), m2m_wifi_connect_psk(), m2m_wifi_connect_wep(), M2M_WIFI_SEC_OPEN, M2M_WIFI_SEC_WEP, M2M_WIFI_SEC_WPA_PSK, NULL, tstrAuthPsk::pu8Passphrase, tstrAuthPsk::pu8Psk, tstrNetworkId::pu8Ssid, tstrM2mWifiWepParams::u8KeyIndx, tstrM2mWifiWepParams::u8KeySz, tstrAuthPsk::u8PassphraseLen, tstrNetworkId::u8SsidLen, WIFI_CRED_DONTSAVE, and WIFI_CRED_SAVE_ENCRYPTED.
Referenced by m2m_wifi_connect().
sint8 m2m_wifi_connect_wep | ( | tenuCredStoreOption | enuCredStoreOption, |
tstrNetworkId * | pstrNetworkId, | ||
tstrAuthWep * | pstrAuthWep | ||
) |
Asynchronous API to connect to an access point using WEP authentication.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to connect to an access point matching the details in pstrNetworkId, with the WEP key provided in pstrAuthWep. On successful connection, the connection details may be saved in WINC flash, according to the option selected in enuCredStoreOption. Once connection has been attempted (whether successful or otherwise), a response event @ref M2M_WIFI_RESP_CON_STATE_CHANGED will be sent to the callback function @ref tpfAppWifiCb provided during initialization @ref m2m_wifi_init. Possible results indicated by the response event are: - @ref M2M_WIFI_DISCONNECTED if the connection attempt failed. - @ref M2M_WIFI_CONNECTED if the connection attempt succeeded.
[in] | enuCredStoreOption | Option to specify whether connection details (i.e. the contents of pstrNetworkId and pstrAuthWep) are stored in WINC flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
[in] | pstrAuthWep | Structure specifying the WEP key. |
References tstrM2mWifiWep::au8WepKey, tstrM2mWifiWepParamsLegacy_1_2::au8WepKey, hexstr_2_bytes(), hif_send(), legacy_connect_prepare_msg(), M2M_ERR_INVALID_ARG, M2M_ERR_MEM_ALLOC, m2m_memcpy(), M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, M2M_WIFI_REQ_CONNECT, M2M_WIFI_SEC_WEP, NULL, tstrAuthWep::pu8WepKey, tstrM2mWifiConnectLegacy_1_2::strSec, tuniM2MWifiAuthLegacy_1_2::strWepInfo, tstrM2mWifiWep::u8KeyIndex, tstrAuthWep::u8KeyIndx, tstrM2mWifiWepParamsLegacy_1_2::u8KeyIndx, tstrM2mWifiWep::u8KeyLen, tstrAuthWep::u8KeySz, tstrM2mWifiWepParamsLegacy_1_2::u8KeySz, tstrM2MWifiSecInfoLegacy_1_2::uniAuth, WEP_104_KEY_STRING_SIZE, WEP_40_KEY_STRING_SIZE, and WEP_KEY_MAX_INDEX.
Referenced by m2m_wifi_connect_sc().
Asynchronous API that attempts to reconnect to the last-associated access point.
Asynchronous Wi-Fi connection function. An application calling this function will cause the firmware to attempt to reconnect to the access point with which it had last successfully connected. A failure to connect will result in a response of @ref M2M_WIFI_RESP_DEFAULT_CONNECT indicating a connection error as defined in the structure @ref tstrM2MDefaultConnResp. Possible errors are: @ref M2M_DEFAULT_CONN_EMPTY_LIST indicating that the connection list is empty, or @ref M2M_DEFAULT_CONN_SCAN_MISMATCH indicating a mismatch for the saved AP name.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_DEFAULT_CONNECT, and NULL.
Referenced by wifi_cb().
Asynchronous API that deletes connection credentials (PSK, WEP key, 802.1X password) from WINC flash. Either deletes all credentials, or for a specific SSID.
Causes WINC to delete connection credentials. If the parameter is NULL, then WINC will delete all credentials from flash. Otherwise WINC will only delete credentials for matching SSID. Callback will report the status of the operation (success or not).
[in] | pcSsid | SSID to match on when deleting credentials. SSID must not contain '\0'. NULL is a valid argument here, in which case all credentials are deleted. |
[in] | u8SsidLen | Length of SSID provided in pcSsid. Must be less than M2M_MAX_SSID_LEN. This parameter is ignored if pcSsid is NULL. |
References tstrM2mWifiApId::au8SSID, hif_send(), M2M_ERR_INVALID_ARG, M2M_MAX_SSID_LEN, m2m_memcpy(), m2m_memset(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQRSP_DELETE_APID, and NULL.
Synchronous API to request disconnection from a network.
Request a Wi-Fi disconnect from the currently connected AP. The connection status will be indicated to the application via a @ref M2M_WIFI_RESP_CON_STATE_CHANGED event. The status will be one of those defined in @ref tenuM2mConnState, with @ref M2M_WIFI_DISCONNECTED indicating a successful disconnection.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_DISCONNECT, and NULL.
Asynchronous function to control the DHCP client functionality within the WINC.
This function allows the application to control the behaviour of the DHCP client function within the WINC once it has associated with an access point. DHCP client functionality is enabled by default.
[in] | u8DhcpEn | The state of the DHCP client feature after successful association with an access point:
|
References hif_send(), M2M_IP_REQ_DISABLE_DHCP, M2M_IP_REQ_ENABLE_DHCP, M2M_REQ_GROUP_IP, and NULL.
Asynchronous API for retrieving the WINC connection status.
Requests the connection status from the WINC including information regarding any access point to which it is currently connected, or any non-AP station that is connected to the WINC. All information will be returned to the application via the Wi-Fi notification callback through the event @ref M2M_WIFI_RESP_CONN_INFO. The connection info can be retrieved using the structure @ref tstrM2MConnInfo which contains: - Connection Security - Connection RSSI - Remote MAC address - Remote IP address - SSID of the network (in cases where the WINC is in non-AP mode)
The code snippet shows an example of how wi-fi connection information is retrieved .
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_GET_CONN_INFO, and NULL.
Request the current RSSI for the current connected AP, the response received in wifi_cb M2M_WIFI_RESP_CURRENT_RSSI.
Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection.
This function will result in the application receiving the RSSI via a @ref M2M_WIFI_RESP_CURRENT_RSSI event.
The code snippet demonstrates how the RSSI request is called in the application's main function and the handling of the event received in the callback.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_CURRENT_RSSI, and NULL.
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC.
This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC.
Legacy (deprecated) asynchronous function to start a DHCP client on the WINC.
This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC.
[in] | addr | The address to issue to a connected client (only one client is supported) |
NMI_API sint8 m2m_wifi_set_static_ip | ( | tstrM2MIPConfig * | pstrStaticIPConf | ) |
Asynchronous API to manually assign a (static) IP address to the WINC.
Assigns a static IP address to the WINC. Typically an infrastructure access point will be able to provide an IP address to all clients after they associate. The WINC will request configuration via DHCP automatically after successfully connecting to an access point. This function should only be called in the event that the network has no DHCP server or in case the application wants to assign a predefined known IP address and the application. This function can be used to assign a static IP address in case the application knows the specifics of the network. The user must keep in mind that assigning a static IP address might result in an IP address conflict. In case of an IP address conflict observed by the WINC the user will get a response of @ref M2M_WIFI_RESP_IP_CONFLICT in the wifi callback. The application is then responsible to either solve the conflict or assign another IP address.
[in] | pstrStaticIPConf | Pointer to a structure holding the static IP configuration (IP, Gateway, subnet mask and DNS address). |
References hif_send(), M2M_IP_REQ_STATIC_IP_CONF, M2M_REQ_GROUP_IP, NM_BSP_B_L_32, NULL, tstrM2MIPConfig::u32DNS, tstrM2MIPConfig::u32Gateway, tstrM2MIPConfig::u32StaticIP, and tstrM2MIPConfig::u32SubnetMask.