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) |
DEPRECATED in v19.6.1 - Kept only for legacy purposes. 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) |
DEPRECATED in v19.6.1 - Kept only for legacy purposes. 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) |
Enable/Disable the DHCP client after connection. More... | |
sint8 | m2m_wifi_get_connection_info (void) |
Asynchronous API for retrieving the WINC IC's 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 IC. More... | |
sint8 | m2m_wifi_request_dhcp_server (uint8 *addr) |
Dhcp requested by the firmware automatically in STA/AP mode). More... | |
sint8 | m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf) |
Synchronous API to manually assign a (static) IP address to the WINC IC. 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_SESSION_CACHING\n @ref WIFI_1X_SPECIFIC_ROOTCERT\n @ref WIFI_1X_TIME_VERIF_MODE\n
[in] | enuOptionName | The option to get. |
[out] | 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,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, SSL_CERT_EXP_CHECK_DISABLE, SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME, SSL_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_SESSION_CACHING\n @ref WIFI_1X_SPECIFIC_ROOTCERT\n @ref WIFI_1X_TIME_VERIF_MODE\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, SSL_CERT_EXP_CHECK_DISABLE, SSL_CERT_EXP_CHECK_EN_IF_SYS_TIME, SSL_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 | ||
) |
DEPRECATED in v19.6.1 - Kept only for legacy purposes.
Legacy asynchronous API to request connection to a specified access point.
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 @ref M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in @ref tenuM2mConnState, successful connection is defined by @ref M2M_WIFI_CONNECTED The only difference between this function and @ref m2m_wifi_default_connect, is the set of connection parameters. Connection using this function is expected to be made to a specific AP and to a specified channel.
[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 the NULL termination). A length greater than the maximum defined SSID 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(-12) 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(-12), 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 main(), socket_cb(), wifi_ap_connect(), wifi_callback(), and wifi_cb().
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's 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's 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 m2m_wifi_connect_sc(), main(), and 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's 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's 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 main(), and 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's 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's flash and, if so, whether they are encrypted before storing. |
[in] | pstrNetworkId | Structure specifying SSID/BSSID and Wi-Fi channel. |
References hif_send(), M2M_ERR_INVALID_ARG, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, 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's 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's 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, hexstr_2_bytes(), hif_send(), 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_SEC_WPA_PSK, NULL, tstrAuthPsk::pu8Passphrase, tstrAuthPsk::pu8Psk, tstrAuthPsk::u8PassphraseLen, and tstrM2mWifiPsk::u8PassphraseLen.
Referenced by m2m_wifi_connect_sc().
NMI_API sint8 m2m_wifi_connect_sc | ( | char * | pcSsid, |
uint8 | u8SsidLen, | ||
uint8 | u8SecType, | ||
void * | pvAuthInfo, | ||
uint16 | u16Ch, | ||
uint8 | u8NoSaveCred | ||
) |
DEPRECATED in v19.6.1 - Kept only for legacy purposes.
Legacy asynchronous API to request connection to a specific AP with the option to save credentials in Flash.
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. The connection status is known when a response of @ref M2M_WIFI_RESP_CON_STATE_CHANGED is received based on the states defined in @ref tenuM2mConnState, successful connection is defined by @ref M2M_WIFI_CONNECTED The only difference between this function and @ref m2m_wifi_connect, is the option to save the access 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.
[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 the NULL termination). A length greater than the maximum defined SSID 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(-12) 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(-12) 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] | u8NoSaveCred | Option to store the access point SSID and password into the WINC flash memory or not. |
Additionally:
References tstr1xAuthCredentials::au8Passwd, tstr1xAuthCredentials::au8UserName, tstrM2mWifiWepParams::au8WepKey, M2M_ERR_INVALID_ARG, M2M_MAX_PSK_LEN, M2M_MAX_SSID_LEN, m2m_strlen(), m2m_wifi_connect_1x_mschap2(), m2m_wifi_connect_open(), m2m_wifi_connect_psk(), m2m_wifi_connect_wep(), M2M_WIFI_SEC_802_1X, 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's 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's 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, hexstr_2_bytes(), hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_MEM_ALLOC, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_connect_prepare_msg(), M2M_WIFI_REQ_CONN, M2M_WIFI_SEC_WEP, NULL, tstrAuthWep::pu8WepKey, tstrM2mWifiWep::u8KeyIndex, tstrAuthWep::u8KeyIndx, tstrM2mWifiWep::u8KeyLen, tstrAuthWep::u8KeySz, 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 correspondingly connect to the last successfully connected AP from the cached connections.\n A failure to connect will result in a response of @ref M2M_WIFI_RESP_DEFAULT_CONNECT indicating the connection error as defined in the structure @ref tstrM2MDefaultConnResp. Possible errors are: The connection list is empty @ref M2M_DEFAULT_CONN_EMPTY_LIST or a mismatch for the saved AP name @ref M2M_DEFAULT_CONN_SCAN_MISMATCH.
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. After the disconnect is complete the driver should receive a response of @ref M2M_WIFI_RESP_CON_STATE_CHANGED based on the states defined in @ref tenuM2mConnState, successful disconnection is defined by @ref M2M_WIFI_DISCONNECTED .
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_DISCONNECT, and NULL.
Referenced by retry_smtp_server().
Enable/Disable the DHCP client after connection.
Synchronous Wi-Fi DHCP enable function. This function will Enable/Disable the DHCP protocol.
[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.
sint8 m2m_wifi_get_connection_info | ( | void | ) |
Asynchronous API for retrieving the WINC IC's connection status.
Asynchronous connection status retrieval function, retrieves the status information of the currently connected AP. The result is passed to the Wi-Fi notification callback through the event @ref M2M_WIFI_RESP_CONN_INFO. Connection information is retrieved from the structure @ref tstrM2MConnInfo. Connection Information retrieved: -Connection Security -Connection RSSI -Remote MAC address -Remote IP address In case the WINC is operating in station mode, the SSID of the AP is also retrieved.
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.
Referenced by timer_callback(), and wifi_cb().
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC.
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 IC.
Referenced by wifi_callback(), and wifi_cb().
Dhcp requested by the firmware automatically in STA/AP mode).
NMI_API sint8 m2m_wifi_set_static_ip | ( | tstrM2MIPConfig * | pstrStaticIPConf | ) |
Synchronous API to manually assign a (static) IP address to the WINC IC.
Assign a static IP address to the WINC board. This function assigns a static IP address in case the AP doesn't have a DHCP server or in case the application wants to assign a predefined known IP address. 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 board 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.