Macros | |
#define | WIFI_1X_TLS_HS_FLAGS_DEFAULT |
#define | WIFI_1X_TLS_HS_FLAGS_PEER_AUTH NBIT1 |
#define | WIFI_1X_TLS_HS_FLAGS_PEER_CERTTIMECHECK NBIT2 |
#define | WIFI_1X_TLS_HS_FLAGS_REQUIRE_TIME NBIT3 |
#define | WIFI_1X_TLS_HS_FLAGS_RSV5 NBIT5 |
#define | WIFI_1X_TLS_HS_FLAGS_RSV7 NBIT7 |
#define | WIFI_1X_TLS_HS_FLAGS_SESSION_CACHING NBIT4 |
#define | WIFI_1X_TLS_HS_FLAGS_SPECIFY_ROOTCERT NBIT6 |
Functions | |
static sint8 | m2m_validate_ap_parameters (CONST tstrM2MAPModeConfig *pstrM2MAPModeConfig) |
static sint8 | m2m_validate_scan_options (tstrM2MScanOption *ptstrM2MScanOption) |
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... | |
static void | m2m_wifi_cb (uint8 u8OpCode, uint16 u16DataSize, uint32 u32Addr) |
sint8 | m2m_wifi_configure_sntp (uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP) |
Configures what NTP server the SNTP client should use. 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... | |
static sint8 | m2m_wifi_connect_prepare_msg (tenuCredStoreOption enuCredStoreOption, tenuM2mSecType enuAuthType, uint16 u16AuthSize, tstrNetworkId *pstrNetworkId, tstrM2mWifiConnHdr *pstrWifiConn) |
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_deinit (void *arg) |
Synchronous API to de-initialize the WINC driver and host interface. 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_disable_ap (void) |
Synchronous API to disable access point mode on the WINC. More... | |
sint8 | m2m_wifi_disable_roaming (void) |
Disable WiFi STA roaming. More... | |
sint8 | m2m_wifi_disconnect (void) |
Synchronous API to request disconnection from a network. More... | |
sint8 | m2m_wifi_download_mode () |
Prepares the WINC before downloading any data (Firmware, Certificates, etc). More... | |
sint8 | m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC. More... | |
sint8 | m2m_wifi_enable_ap_ext (CONST tstrM2MAPModeConfig *pstrM2MAPModeConfig) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC with extended options. More... | |
sint8 | m2m_wifi_enable_dhcp (uint8 u8DhcpEn) |
Asynchronous function to control the DHCP client functionality within the WINC. More... | |
sint8 | m2m_wifi_enable_firmware_logs (uint8 u8Enable) |
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance) More... | |
sint8 | m2m_wifi_enable_roaming (uint8 bEnableDhcp) |
Enable WiFi STA roaming. More... | |
sint8 | m2m_wifi_enable_sntp (uint8 bEnable) |
Asynchronous API to enable or disable the native Simple Network Time Protocol(SNTP) client running on the WINC. More... | |
sint8 | m2m_wifi_get_connection_info (void) |
Asynchronous API for retrieving the WINC connection status. More... | |
sint8 | m2m_wifi_get_firmware_version (tstrM2mRev *pstrRev) |
Synchronous API to obtain the firmware version currently running on the WINC IC. More... | |
sint8 | m2m_wifi_get_mac_address (uint8 *pu8MacAddr) |
Request the current MAC address of the device (the working mac address). (the function is Blocking until response received) More... | |
uint8 | m2m_wifi_get_num_ap_found (void) |
Reads the number of AP's found in the last Scan Request, The function read the number of AP's from global variable which updated in the wifi_cb in M2M_WIFI_RESP_SCAN_DONE. More... | |
sint8 | m2m_wifi_get_otp_mac_address (uint8 *pu8MacAddr, uint8 *pu8IsValid) |
Request the MAC address stored on the OTP (one time programmable) memory of the device. (the function is Blocking until response received) More... | |
uint8 | m2m_wifi_get_sleep_mode (void) |
Get the current Power save mode. More... | |
uint8 | m2m_wifi_get_state (void) |
Get the wifi state. More... | |
sint8 | m2m_wifi_get_system_time (void) |
Asynchronous API to obtain the system time in use by the WINC. More... | |
sint8 | m2m_wifi_handle_events (void *arg) |
Synchronous M2M event handler function. More... | |
sint8 | m2m_wifi_init (tstrWifiInitParam *pWifiInitParam) |
Synchronous API to initialize the WINC driver. More... | |
sint8 | m2m_wifi_init_hold () |
First part of m2m_wifi_init, up to the point of initializing SPI for flash access. More... | |
sint8 | m2m_wifi_init_start (tstrWifiInitParam *pWifiInitParam) |
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off. More... | |
sint8 | m2m_wifi_p2p (uint8 u8Channel) |
sint8 | m2m_wifi_p2p_disconnect (void) |
sint8 | m2m_wifi_prng_get_random_bytes (uint8 *pu8PrngBuff, uint16 u16PrngSize) |
Get random bytes using the PRNG bytes. More... | |
sint8 | m2m_wifi_reinit (tstrWifiInitParam *pWifiInitParam) |
De-initialize and then initialize wifi. Resets the WINC. More... | |
sint8 | m2m_wifi_reinit_hold (void) |
First part of m2m_wifi_reinit, up to the point of initializing SPI for flash access. More... | |
sint8 | m2m_wifi_reinit_start (tstrWifiInitParam *pWifiInitParam) |
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off. More... | |
sint8 | m2m_wifi_req_client_ctrl (uint8 u8Cmd) |
Send a command to the PS Client (An WINC board running the ps_firmware), if the PS client send any commands it will be received in wifi_cb M2M_WIFI_RESP_CLIENT_INFO. 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_req_scan_result (uint8 index) |
Reads the AP information from the Scan Result list with the given index, the response received in wifi_cb M2M_WIFI_RESP_SCAN_RESULT, the response pointer should be casted with tstrM2mWifiscanResult structure. More... | |
sint8 | m2m_wifi_req_server_init (uint8 ch) |
Initialize the PS Server, The WINC support non secure communication with another WINC, (SERVER/CLIENT) through one byte command (probe request and probe response) without any connection setup. 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_request_scan (uint8 ch) |
Asynchronous API to request the WINC to scan for networks. More... | |
sint8 | m2m_wifi_request_scan_ssid_list (uint8 ch, uint8 *u8Ssidlist) |
Asynchronous wi-fi scan request on the given channel and the hidden scan list. More... | |
sint8 | m2m_wifi_request_sleep (uint32 u32SlpReqTime) |
Asynchronous API to place the WINC into sleep mode for a specified period of time. More... | |
sint8 | m2m_wifi_send_crl (tstrTlsCrlInfo *pCRL) |
Asynchronous API that notifies the WINC with the Certificate Revocation List. More... | |
sint8 | m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize) |
Asynchronous API to queue an Ethernet packet for transmission by the WINC. More... | |
sint8 | m2m_wifi_set_battery_voltage (uint16 u16BattVoltx100) |
Set the battery voltage to update the firmware calculations. Not implemented in WINC3400 firmware. More... | |
sint8 | m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement) |
Asynchronous API to add or remove a user-defined Information Element. More... | |
sint8 | m2m_wifi_set_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength) |
Set the WINC3400 device name which is used as P2P device name. More... | |
sint8 | m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt) |
Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods. More... | |
sint8 | m2m_wifi_set_mac_address (uint8 au8MacAddress[6]) |
Asynchronous API for assigning a MAC address to the WINC. More... | |
sint8 | m2m_wifi_set_power_profile (uint8 u8PwrMode) |
Change the power profile mode Not implemented in WINC3400 firmware. More... | |
sint8 | m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption) |
Synchronous API for configuring the behaviour of the WINC network scanning functions. More... | |
sint8 | m2m_wifi_set_scan_region (uint16 ScanRegion) |
Synchronous API for configuring the regulatory restrictions that may affect the WINC scanning behaviour. More... | |
sint8 | m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn) |
Set the power saving mode for the WINC3400. 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_set_stop_scan_on_first (uint8 u8StopScanOption) |
Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scanning functions. More... | |
sint8 | m2m_wifi_set_system_time (uint32 u32UTCSeconds) |
Asynchronous function for setting the system time within the WINC. More... | |
sint8 | m2m_wifi_set_tx_power (uint8 u8TxPwrLevel) |
set the TX power tenuM2mTxPwrLevel More... | |
sint8 | m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrM2MAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect) |
Asynchronous API for control of Wi-Fi provisioning functionality. More... | |
sint8 | m2m_wifi_start_provision_mode_ext (tstrM2MAPModeConfig *pstrAPModeConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect) |
Asynchronous API for control of Wi-Fi provisioning functionality with extended options. More... | |
sint8 | m2m_wifi_stop_provision_mode (void) |
Synchronous API for terminating provisioning mode on the WINC. More... | |
sint8 | m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber) |
Asynchronous API to engage the WINC Wi-Fi Protected Setup (enrollee) function. More... | |
sint8 | m2m_wifi_wps_disable (void) |
Asynchronous API that disables Wi-Fi Protected Setup mode in the WINC. More... | |
void | m2m_wifi_yield (void) |
Yield from processing more synchronous M2M events. More... | |
Variables | |
static uint8 | gau81xRootSha1 [20] = {0} |
static tpfAppWifiCb | gpfAppWifiCb = NULL |
static uint32 | gu321xTlsHsFlags = WIFI_1X_TLS_HS_FLAGS_DEFAULT |
static volatile uint8 | gu8ChNum |
static volatile uint8 | gu8scanInProgress = 0 |
static volatile uint8 | gu8WifiState = WIFI_STATE_DEINIT |
#define WIFI_1X_TLS_HS_FLAGS_DEFAULT |
#define WIFI_1X_TLS_HS_FLAGS_PEER_AUTH NBIT1 |
Referenced by m2m_wifi_1x_get_option(), and m2m_wifi_1x_set_option().
#define WIFI_1X_TLS_HS_FLAGS_PEER_CERTTIMECHECK NBIT2 |
Referenced by m2m_wifi_1x_get_option(), and m2m_wifi_1x_set_option().
#define WIFI_1X_TLS_HS_FLAGS_REQUIRE_TIME NBIT3 |
Referenced by m2m_wifi_1x_get_option(), and m2m_wifi_1x_set_option().
#define WIFI_1X_TLS_HS_FLAGS_RSV5 NBIT5 |
#define WIFI_1X_TLS_HS_FLAGS_RSV7 NBIT7 |
#define WIFI_1X_TLS_HS_FLAGS_SESSION_CACHING NBIT4 |
Referenced by m2m_wifi_1x_get_option(), and m2m_wifi_1x_set_option().
#define WIFI_1X_TLS_HS_FLAGS_SPECIFY_ROOTCERT NBIT6 |
Referenced by m2m_wifi_1x_get_option(), and m2m_wifi_1x_set_option().
|
static |
References M2M_ERR, M2M_ERR_FAIL, M2M_MAX_PSK_LEN, M2M_MAX_SSID_LEN, M2M_MIN_PSK_LEN, m2m_strlen(), M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_SEC_OPEN, M2M_WIFI_SEC_WEP, M2M_WIFI_SEC_WPA_PSK, NULL, WEP_104_KEY_STRING_SIZE, WEP_40_KEY_STRING_SIZE, and WEP_KEY_MAX_INDEX.
Referenced by m2m_wifi_enable_ap_ext(), and m2m_wifi_start_provision_mode_ext().
|
static |
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. |
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, 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. |
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, 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.
References BYTE_0, BYTE_1, BYTE_2, BYTE_3, gpfAppWifiCb, gu8ChNum, gu8scanInProgress, hif_receive(), M2M_ERR, M2M_INFO, m2m_memcpy(), m2m_memset(), M2M_SUCCESS, M2M_WIFI_REQ_DHCP_CONF, M2M_WIFI_REQ_DHCP_FAILURE, M2M_WIFI_REQ_WPS, M2M_WIFI_REQRSP_DELETE_APID, M2M_WIFI_RESP_CLIENT_INFO, M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_CONN_INFO, M2M_WIFI_RESP_CURRENT_RSSI, M2M_WIFI_RESP_DEFAULT_CONNECT, M2M_WIFI_RESP_ETHERNET_RX_PACKET, M2M_WIFI_RESP_GET_PRNG, M2M_WIFI_RESP_GET_SYS_TIME, M2M_WIFI_RESP_IP_CONFLICT, M2M_WIFI_RESP_MEMORY_RECOVER, M2M_WIFI_RESP_PROVISION_INFO, M2M_WIFI_RESP_SCAN_DONE, M2M_WIFI_RESP_SCAN_RESULT, NULL, tstrPrng::pu8RngBuff, rx_buf, tstrM2mIpCtrlBuf::u16DataSize, tstrM2mIpRsvdPkt::u16PktOffset, tstrM2mIpRsvdPkt::u16PktSz, tstrPrng::u16PrngSize, tstrM2mIpCtrlBuf::u16RemainingDataSize, tstrM2mWifiStateChanged::u8CurrState, and tstrM2mScanDone::u8NumofCh.
Referenced by m2m_wifi_init_start().
sint8 m2m_wifi_configure_sntp | ( | uint8 * | pu8NTPServerName, |
uint8 | u8NTPServerNameLength, | ||
tenuSNTPUseDHCP | useDHCP | ||
) |
Configures what NTP server the SNTP client should use.
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org). |
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH |
[in] | useDHCP | Should the NTP server provided by the DHCP server be used. |
Configures what NTP server the SNTP client should use. Only 1 server name can be provided, if the configured server name begins with an asterisk then it will be treated as a server pool. The SNTP client can also use the NTP server provided by the DHCP server through option 42. By default the NTP server provided by DHCP will be tried first, then the built-in default NTP server (time.nist.gov) will be used.
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org). |
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH. |
[in] | useDHCP | Explicity tell the WINC if it should use the NTP server provided by the DHCP server or not. |
Configures what NTP server the SNTP client should use. Only 1 server name can be provided, if the configured server name begins with an asterisk then it will be treated as a server pool. The SNTP client can also use the NTP server provided by the DHCP server through option 42. By default the NTP server provided by DHCP will be tried first, then the built-in default NTP server (time.nist.gov) will be used.
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org). |
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH. |
[in] | useDHCP | Explicity tell the WINC if it should use the NTP server provided by the DHCP server or not. |
References tstrM2MSNTPConfig::acNTPServer, tstrM2MSNTPConfig::enuUseDHCP, hif_send(), M2M_ERR_FAIL, m2m_memcpy(), M2M_NTP_MAX_SERVER_NAME_LENGTH, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_CONFIG_SNTP, and NULL.
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.
DEPRECATED in v19.6.1 - Kept only for legacy purposes.
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:
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().
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. |
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.
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. |
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.
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. |
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(), 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.
|
static |
References tstrM2mConnCredCmn::au8Bssid, tstrM2mConnCredCmn::au8Ssid, tstrNetworkId::enuChannel, M2M_CRED_ENCRYPT_FLAG, M2M_CRED_STORE_FLAG, M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_MAC_ADDRES_LEN, M2M_MAX_SSID_LEN, m2m_memcpy(), m2m_memset(), M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_CONN_BSSID_FLAG, M2M_WIFI_NUM_AUTH_TYPES, M2M_WIFI_SEC_INVALID, NULL, tstrNetworkId::pu8Bssid, tstrNetworkId::pu8Ssid, tstrM2mWifiConnHdr::strConnCredCmn, tstrM2mWifiConnHdr::strConnCredHdr, tstrM2mConnCredHdr::u16CredSize, tstrM2mConnCredCmn::u8AuthType, tstrM2mConnCredHdr::u8Channel, tstrM2mConnCredHdr::u8CredStoreFlags, tstrM2mConnCredCmn::u8Options, tstrNetworkId::u8SsidLen, tstrM2mConnCredCmn::u8SsidLen, WIFI_CRED_DONTSAVE, WIFI_CRED_SAVE_ENCRYPTED, and WIFI_CRED_SAVE_UNENCRYPTED.
Referenced by m2m_wifi_connect_1x_mschap2(), m2m_wifi_connect_1x_tls(), m2m_wifi_connect_open(), m2m_wifi_connect_psk(), and m2m_wifi_connect_wep().
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. |
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, 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.
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.
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.
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:
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.
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. |
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, 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.
sint8 m2m_wifi_default_connect | ( | void | ) |
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.
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.
sint8 m2m_wifi_deinit | ( | void * | arg | ) |
Synchronous API to de-initialize the WINC driver and host interface.
De-initialize the WINC driver and host interface.
De-initialization function for the WINC driver. De-initializes the host interface and frees any resources used by the M2M_WIFI layer. This function must be called in the application closing phase to ensure that all resources have been correctly released.
[in] | arg | Opaque argument, not used in current implementation. Application should use null. |
Synchronous de-initialization function for the WINC driver. De-initializes the host interface and frees any resources used by the M2M_WIFI layer. This function must be called in the application closing phase to ensure that all resources have been correctly released. No arguments are expected to be passed in.
[in] | arg | Opaque argument, not used in current implementation. Application should use null. |
References gu8WifiState, hif_deinit(), M2M_SUCCESS, nm_drv_deinit(), NULL, and WIFI_STATE_DEINIT.
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. |
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.
sint8 m2m_wifi_disable_ap | ( | void | ) |
Synchronous API to disable access point mode on the WINC.
Synchronous API to disable access point mode on the WINC IC.
Must be called only when the AP is enabled through the @ref m2m_wifi_enable_ap function. Otherwise the call to this function will not be useful.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DISABLE_AP, and NULL.
sint8 m2m_wifi_disable_roaming | ( | void | ) |
Disable WiFi STA roaming.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_ROAMING, NULL, and tstrM2mWiFiRoaming::u8EnableRoaming.
sint8 m2m_wifi_disconnect | ( | void | ) |
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.
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.
sint8 m2m_wifi_download_mode | ( | void | ) |
Prepares the WINC before downloading any data (Firmware, Certificates, etc).
Prepares the WINC board before downloading any data (Firmware, Certificates, etc).
This function should be called before attempting to download any data to the WINC. Performs the appropriate WINC driver initialization, this includes bus initialization, interrupt enabling and it halts the chip to allow for the firmware downloads. Firmware can be downloaded through a number of interfaces, UART, I2C and SPI.
This function should be called before attempting to download any data to the WINC board. Performs the appropriate WINC driver initialization, this includes bus initialization, interrupt enabling and it halts the chip to allow for the firmware downloads. Firmware can be downloaded through a number of interfaces, UART, I2C and SPI.
References enable_interrupts(), gu8WifiState, M2M_SUCCESS, nm_drv_init_download_mode(), and WIFI_STATE_INIT.
sint8 m2m_wifi_enable_ap | ( | CONST tstrM2MAPConfig * | pstrM2MAPConfig | ) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC.
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC.
The WINC supports the ability to operate as an access point with the following limitations: - Only 1 station may be associated at any given time. - Open system and WEP are the only security suites supported.
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
The WINC IC supports the ability to operate as an access point with the following limitations: - Only 1 station may be associated at any given time. - Open system and WEP are the only security suites supported.
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
References tstrM2MAPConfigExt::au8DefRouterIP, tstrM2MAPConfigExt::au8DNSServerIP, tstrM2MAPConfigExt::au8SubnetMask, m2m_memcpy(), m2m_wifi_enable_ap_ext(), tstrM2MAPModeConfig::strApConfig, and tstrM2MAPModeConfig::strApConfigExt.
sint8 m2m_wifi_enable_ap_ext | ( | CONST tstrM2MAPModeConfig * | pstrM2MAPModeConfig | ) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC with extended options.
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC with extended options.
The WINC supports the ability to operate as an access point with the following limitations: - Only 1 station may be associated at any given time. - Open system and WEP are the only security suites supported.
[in] | pstrM2MAPModeConfig | A structure holding the AP configurations. |
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
The WINC IC supports the ability to operate as an access point with the following limitations: - Only 1 station may be associated at any given time. - Open system and WEP are the only security suites supported.
[in] | pstrM2MAPModeConfig | A structure holding the AP configurations. |
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function and the handling of the event M2M_WIFI_REQ_DHCP_CONF, to indicate successful connection.
References hif_send(), M2M_ERR_FAIL, M2M_ERR_SEND, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_validate_ap_parameters(), M2M_WIFI_REQ_ENABLE_AP, M2M_WIFI_REQ_ENABLE_AP_LEGACY, and NULL.
Asynchronous function to control the DHCP client functionality within the WINC.
Enable/Disable the DHCP client after connection.
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:
|
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.
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance)
Enable or Disable logs in run time.
[in] | u8Enable | Set 1 to enable the logs 0 for disable |
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance).
[in] | u8Enable | Set 1 to enable the logs, 0 for disable. |
[in] | u8Enable | Set 1 to enable the logs 0 for disable |
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance).
[in] | u8Enable | Set 1 to enable the logs, 0 for disable. |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_ENABLE_LOGS, NULL, and tstrM2mEnableLogs::u8Enable.
Enable WiFi STA roaming.
m2m_wifi_enable_roaming enables the firmware to trigger the roaming algorithm/steps on link loss with the current AP. If roaming is successful, the @ref M2M_WIFI_RESP_CON_STATE_CHANGED message with state as @ref M2M_WIFI_ROAMED is sent to the host. Additionally a @ref M2M_WIFI_REQ_DHCP_CONF message with new DHCP lease details is sent to host (only if bEnableDhcp=1). If roaming is unsuccessful, a @ref M2M_WIFI_RESP_CON_STATE_CHANGED message with state as @ref M2M_WIFI_DISCONNECTED is sent to host.
[in] | bEnableDhcp | 0 : Disables DHCP client execution after roaming to new AP 1 : Enables DHCP client execution after roaming to new AP |
m2m_wifi_enable_roaming enables the firmware to trigger the roaming algorithm/steps on link loss with the current AP. If roaming is successful, the @ref M2M_WIFI_RESP_CON_STATE_CHANGED message with state as @ref M2M_WIFI_ROAMED is sent to host. Additionally a @ref M2M_WIFI_REQ_DHCP_CONF message with new DHCP lease details is sent to host (only if bEnableDhcp=1). If roaming is unsuccessful, @ref M2M_WIFI_RESP_CON_STATE_CHANGED message with state as @ref M2M_WIFI_DISCONNECTED is sent to host.
[in] | bEnableDhcp | 0 : Disables DHCP client execution after roaming to new AP 1 : Enables DHCP client execution after roaming to new AP |
References hif_send(), M2M_ERR_INVALID_ARG, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_ROAMING, NULL, tstrM2mWiFiRoaming::u8EnableDhcp, and tstrM2mWiFiRoaming::u8EnableRoaming.
Asynchronous API to enable or disable the native Simple Network Time Protocol(SNTP) client running on the WINC.
Synchronous function to enable/disable the native Simple Network Time Protocol(SNTP) client in the WINC15x0 firmware.
The SNTP client is enabled by default during chip initialization. This function can be used to disable or subsequently re-enable the service. The service is capable of synchronizing the WINC system clock to the UTC time from a well-known (and trusted) time server, for example "time.nist.gov". By default the SNTP client will update the system time once every 24 hours. The ability to track the time accurately is important for various applications such as checking expiry of X509 certificates during TLS (Transport Layer Security) session establishment. It is highly recommended to leave SNTP enabled if there is no alternative source of timing information. For systems including an RTC device, SNTP may not be needed and the WINC's time may be set using the @ref m2m_wifi_set_system_time function.
[in] | bEnable | Enables or disables the SNTP service '0' :disable SNTP '1' :enable SNTP |
The SNTP is enabled by default at start-up.The SNTP client at firmware is used to synchronize the system clock to the UTC time from the well known time servers (e.g. "time-c.nist.gov"). The SNTP client uses a default update cycle of 1 day. The UTC is important for checking the expiration date of X509 certificates used while establishing TLS (Transport Layer Security) connections. It is highly recommended to use it if there is no other means to get the UTC time. If there is a RTC on the host MCU, the SNTP could be disabled and the host should set the system time to the firmware using the @ref m2m_wifi_set_system_time function.
[in] | bEnable | Enables or disables the SNTP service '0' :disable SNTP '1' :enable SNTP |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_DISABLE_SNTP_CLIENT, M2M_WIFI_REQ_ENABLE_SNTP_CLIENT, and NULL.
sint8 m2m_wifi_get_connection_info | ( | void | ) |
Asynchronous API for retrieving the WINC connection status.
Asynchronous API for retrieving the WINC IC's 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 .
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.
sint8 m2m_wifi_get_firmware_version | ( | tstrM2mRev * | pstrRev | ) |
Synchronous API to obtain the firmware version currently running on the WINC IC.
Get Firmware version info.
Synchronous API to obtain the firmware version currently running on the WINC.
[out] | pstrRev | pointer holds address of structure "tstrM2mRev" that contains the firmware version parameters |
Get the Firmware version info from the active partition, as defined in the structure @ref tstrM2mRev.
[out] | pstrRev | Pointer to a variable of type tstrM2mRev, which contains the firmware version parameters. |
Get the Firmware version info from the active partition, as defined in the structure tstrM2mRev.
[out] | pstrRev | Pointer to the structure tstrM2mRev that contains the firmware version parameters. |
References hif_chip_sleep(), hif_chip_wake(), M2M_SUCCESS, and nm_get_firmware_full_info().
Request the current MAC address of the device (the working mac address). (the function is Blocking until response received)
Synchronous API to retrieve the MAC address currently in use by the device.
[out] | pu8MacAddr | Output MAC address buffer of 6 bytes size. |
This function obtains the MAC address that is currently in use by the device. If the function returns with @ref M2M_SUCCESS then the content of the memory referenced by pu8MacAddr will be populated with the 6 byte MAC address; otherwise, that memory will be left unchanged.
[out] | pu8MacAddr | Pointer to a buffer in memory containing a 6-byte MAC address (provided function returns M2M_SUCCESS). |
Function to retrieve the current MAC address. The function is blocking until the response is received.
[out] | pu8MacAddr | Pointer to a buffer in memory containing a 6-byte MAC address (provided function returns M2M_SUCCESS). |
References hif_chip_sleep(), hif_chip_wake(), M2M_SUCCESS, and nmi_get_mac_address().
uint8 m2m_wifi_get_num_ap_found | ( | void | ) |
Reads the number of AP's found in the last Scan Request, The function read the number of AP's from global variable which updated in the wifi_cb in M2M_WIFI_RESP_SCAN_DONE.
Synchronous function to retrieve the number of AP's found during the last scan operation.
This function allows the application to recover the number of access points discovered during the most recent scan activity. This is achieved via a global variable in the WINC driver that is populated when receiving the @ref M2M_WIFI_RESP_SCAN_DONE event. Function to be used in STA mode only.
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
The function reads the number of APs from global variable which was updated in the Wi-Fi callback function through the @ref M2M_WIFI_RESP_SCAN_DONE event. Function used only in STA mode only.
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
References gu8ChNum.
Request the MAC address stored on the OTP (one time programmable) memory of the device. (the function is Blocking until response received)
Synchronous API to query the MAC address programmed into the WINC ICs OTP memory.
Synchronous API to query the MAC address programmed into the WINC OTP memory.
[out] | pu8MacAddr | Output MAC address buffer of 6 bytes size. Valid only if *pu8Valid=1. |
[out] | pu8IsValid | A output boolean value to indicate the validity of pu8MacAddr in OTP. Output zero if the OTP memory is not programmed, non-zero otherwise. |
This function attempts to read the device's MAC address from the One Time Programmable (OTP) memory on the WINC. The presence (yes or no) of a MAC address in the OTP memory and, in the case of it being present, its value is returned via RAM pointed to by the input arguments. Request the MAC address stored on the One Time Programmable(OTP) memory of the device. The function is blocking until the response is received.
[out] | pu8MacAddr | Output MAC address buffer 6 bytes in size. Valid only if *pu8Valid=1. |
[out] | pu8IsValid | A boolean value set by the callee to indicate the validity of pu8MacAddr in OTP. If no MAC has been programmed in the OTP the value of this parameter will be zero; otherwise it will be non-zero. |
This function attempts to read the device's MAC address from the One Time Programmable (OTP) memory on the IC. The presence (yes or no) of a MAC address in the OTP memory and, in the case of it being present, its value is returned via RAM pointed to by the input arguments. Request the MAC address stored on the One Time Programmable(OTP) memory of the device. The function is blocking until the response is received.
[out] | pu8MacAddr | Output MAC address buffer 6 bytes in size. Valid only if *pu8Valid=1. |
[out] | pu8IsValid | A boolean value set by the callee to indicate the validity of pu8MacAddr in OTP. If no MAC has been programmed in the OTP the value of this parameter will be zero; otherwise it will be non-zero. |
References hif_chip_sleep(), hif_chip_wake(), M2M_SUCCESS, and nmi_get_otp_mac_address().
uint8 m2m_wifi_get_sleep_mode | ( | void | ) |
Get the current Power save mode.
Synchronous power save mode retrieval function.
Synchronous API to retrieve the current power save mode of the WINC.
References hif_get_sleep_mode().
uint8 m2m_wifi_get_state | ( | void | ) |
Get the wifi state.
References gu8WifiState, nm_get_state(), NM_STATE_DEINIT, NM_STATE_INIT, NM_STATE_START, WIFI_STATE_DEINIT, WIFI_STATE_INIT, and WIFI_STATE_START.
sint8 m2m_wifi_get_system_time | ( | void | ) |
Asynchronous API to obtain the system time in use by the WINC.
Asynchronous API to obtain the system time in use by the WINC IC.
This function will request the WINC to report its current system time to the application. The information will arrive at the application via the @ref tpfAppWifiCb and event @ref M2M_WIFI_RESP_GET_SYS_TIME. Response time retrieved is parsed into the members defined in the structure @ref tstrSystemTime.
Asynchronous function used to retrieve the system time through the use of the response @ref M2M_WIFI_RESP_GET_SYS_TIME. Response time retrieved is parsed into the members defined in the structure @ref tstrSystemTime.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_GET_SYS_TIME, and NULL.
sint8 m2m_wifi_handle_events | ( | void * | arg | ) |
Synchronous M2M event handler function.
This function is responsible for handling interrupts received from the WINC firmware. Applications should call this function periodically in-order to receive the events that are to be handled by the callback functions implemented by the application. Handle the various events received from the WINC. Whenever an event happens in the WINC (e.g. Connection, Disconnection, DHCP, etc), the WINC will interrupt the host to let it know that a new event has occurred. The host driver will attempt to handle these events whenever the application decides to do so by calling the m2m_wifi_handle_events function. It is mandatory to call this function periodically and independently of any other condition. It is ideal to include this function in the main and the most frequent loop of the host application.
This function is responsible for handling interrupts received from the WINC firmware. Applications should call this function periodically in-order to receive the events that are to be handled by the callback functions implemented by the application. Handle the various events received from the WINC board. Whenever an event happens in the WINC board (e.g. Connection, Disconnection, DHCP, etc), the WINC will interrupt the host to let it know that a new event has occurred. The host driver will attempt to handle these events whenever the application decides to do so by calling the m2m_wifi_handle_events function. It is mandatory to call this function periodically and independently of any other condition. It is ideal to include this function in the main and the most frequent loop of the host application.
References hif_handle_isr(), M2M_SUCCESS, m2m_wifi_get_state(), and WIFI_STATE_START.
sint8 m2m_wifi_init | ( | tstrWifiInitParam * | pWifiInitParam | ) |
Synchronous API to initialize the WINC driver.
This function initializes the WINC driver by registering the callback function for the M2M_WIFI layer (also the callback function for bypass mode/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. The possible Wi-Fi events that are expected to be received through the callback function (provided by the application) to the M2M_WIFI layer are listed below: - @ref M2M_WIFI_RESP_CON_STATE_CHANGED - @ref M2M_WIFI_RESP_CONN_INFO - @ref M2M_WIFI_REQ_DHCP_CONF - @ref M2M_WIFI_REQ_WPS - @ref M2M_WIFI_RESP_IP_CONFLICT - @ref M2M_WIFI_RESP_SCAN_DONE - @ref M2M_WIFI_RESP_SCAN_RESULT - @ref M2M_WIFI_RESP_CURRENT_RSSI - @ref M2M_WIFI_RESP_CLIENT_INFO - @ref M2M_WIFI_RESP_PROVISION_INFO - @ref M2M_WIFI_RESP_DEFAULT_CONNECT - @ref M2M_WIFI_RESP_ETHERNET_RX_PACKET (if bypass mode is enabled) - @ref M2M_WIFI_RESP_WIFI_RX_PACKET (if monitoring mode is enabled) Any application using the WINC driver must call this function at the start of its main function.
[in] | pWifiInitParam | This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function, monitoring mode callback and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
This function initializes the WINC driver by registering the callback function for the M2M_WIFI layer (also the callback function for bypass mode/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. The possible Wi-Fi events that are expected to be received through the callback function (provided by the application) to the M2M_WIFI layer are listed below: - @ref M2M_WIFI_RESP_CON_STATE_CHANGED - @ref M2M_WIFI_RESP_CONN_INFO - @ref M2M_WIFI_REQ_DHCP_CONF - @ref M2M_WIFI_REQ_WPS - @ref M2M_WIFI_RESP_IP_CONFLICT - @ref M2M_WIFI_RESP_SCAN_DONE - @ref M2M_WIFI_RESP_SCAN_RESULT - @ref M2M_WIFI_RESP_CURRENT_RSSI - @ref M2M_WIFI_RESP_CLIENT_INFO - @ref M2M_WIFI_RESP_PROVISION_INFO - @ref M2M_WIFI_RESP_DEFAULT_CONNECT - @ref M2M_WIFI_RESP_ETHERNET_RX_PACKET (if bypass mode is enabled) - @ref M2M_WIFI_RESP_WIFI_RX_PACKET (if monitoring mode is enabled) Any application using the WINC driver must call this function at the start of its main function.
[in] | pWifiInitParam | This is a pointer to a structure of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function, monitoring mode callback and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
References M2M_SUCCESS, m2m_wifi_init_hold(), and m2m_wifi_init_start().
sint8 m2m_wifi_init_hold | ( | void | ) |
First part of m2m_wifi_init, up to the point of initializing SPI for flash access.
References gu8WifiState, M2M_ERR_FAIL, M2M_SUCCESS, nm_drv_init_hold(), and WIFI_STATE_INIT.
sint8 m2m_wifi_init_start | ( | tstrWifiInitParam * | pWifiInitParam | ) |
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off.
[in] | pWifiInitParam | This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
[in] | pWifiInitParam | This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
References tstrEthInitParam::au8ethRcvBuf, tstrM2mRev::BuildDate, tstrM2mRev::BuildTime, tstrWifiInitParam::GainTableIndex, gpfAppWifiCb, gu8scanInProgress, gu8WifiState, hif_enable_access(), hif_init(), hif_register_cb(), M2M_DRIVER_VERSION_MAJOR_NO, M2M_DRIVER_VERSION_MINOR_NO, M2M_DRIVER_VERSION_PATCH_NO, M2M_ERR, M2M_ERR_FAIL, M2M_ERR_FW_VER_MISMATCH, M2M_HIF_BLOCK_VALUE, M2M_HIF_MAJOR_VALUE, M2M_HIF_MINOR_VALUE, M2M_INFO, m2m_ota_get_firmware_version(), M2M_RELEASE_VERSION_MAJOR_NO, M2M_RELEASE_VERSION_MINOR_NO, M2M_RELEASE_VERSION_PATCH_NO, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_wifi_ble_set_gain_table(), m2m_wifi_cb(), m2m_wifi_get_firmware_version(), M2M_WIFI_MODE_ETHERNET, M2M_WIFI_MODE_NORMAL, nm_drv_deinit(), nm_drv_init_start(), nm_get_firmware_full_info(), NULL, tstrEthInitParam::pfAppEthCb, tstrWifiInitParam::pfAppWifiCb, tstrWifiInitParam::strEthInitParam, tstrEthInitParam::u16ethRcvBufSize, tstrM2mRev::u16FirmwareSvnNum, tstrM2mRev::u8DriverMajor, tstrM2mRev::u8DriverMinor, tstrM2mRev::u8DriverPatch, tstrEthInitParam::u8EthernetEnable, tstrM2mRev::u8FirmwareMajor, tstrM2mRev::u8FirmwareMinor, tstrM2mRev::u8FirmwarePatch, WIFI_STATE_DEINIT, and WIFI_STATE_START.
sint8 m2m_wifi_p2p_disconnect | ( | void | ) |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DISABLE_P2P, and NULL.
Get random bytes using the PRNG bytes.
Asynchronous function for retrieving from the firmware a pseudo-random set of bytes.
[in] | u16PrngSize | Size of the required random bytes to be generated. |
[in] | pu8PrngBuff | Pointer to user allocated buffer. |
Asynchronous function for retrieving from the firmware a pseudo-random set of bytes as specified in the size passed in as a parameter. The registered wifi-cb function retrieves the random bytes through the response @ref M2M_WIFI_RESP_GET_PRNG
[in] | pu8PrngBuff | Pointer to a buffer to receive data. |
[in] | u16PrngSize | Request size in bytes |
Asynchronous function for retrieving from the firmware a pseudo-random set of bytes as specified in the size passed in as a parameter. The registered wifi-cb function retrieves the random bytes through the response @ref M2M_WIFI_RESP_GET_PRNG
[in] | pu8PrngBuff | Pointer to a buffer to receive data. |
[in] | u16PrngSize | Requested size in bytes. Maximum 1580. |
References hif_send(), M2M_BUFFER_MAX_SIZE, M2M_ERR, M2M_ERR_FAIL, M2M_HIF_HDR_OFFSET, M2M_HIF_MAX_PACKET_SIZE, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_GET_PRNG, NULL, tstrPrng::pu8RngBuff, and tstrPrng::u16PrngSize.
sint8 m2m_wifi_reinit | ( | tstrWifiInitParam * | pWifiInitParam | ) |
De-initialize and then initialize wifi. Resets the WINC.
[in] | pWifiInitParam | This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
[in] | pWifiInitParam | This is a pointer to a variable of type tstrWifiInitParam which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
References M2M_ERR_FAIL, M2M_SUCCESS, m2m_wifi_reinit_hold(), and m2m_wifi_reinit_start().
sint8 m2m_wifi_reinit_hold | ( | void | ) |
First part of m2m_wifi_reinit, up to the point of initializing SPI for flash access.
References m2m_wifi_deinit(), m2m_wifi_init_hold(), and NULL.
sint8 m2m_wifi_reinit_start | ( | tstrWifiInitParam * | pWifiInitParam | ) |
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off.
[in] | pWifiInitParam | This is a pointer to the tstrWifiInitParam structure which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
[in] | pWifiInitParam | This is a pointer to the tstrWifiInitParam structure which contains pointers to the application WIFI layer callback function (see tpfAppWifiCb), monitoring mode callback (see tpfAppEthCb) and tstrEthInitParam structure (which contains initialization settings for bypass mode). |
References m2m_wifi_init_start().
Send a command to the PS Client (An WINC board running the ps_firmware), if the PS client send any commands it will be received in wifi_cb M2M_WIFI_RESP_CLIENT_INFO.
Asynchronous command sending function to the PS Client.
[in] | cmd | Control command sent from PS Server to PS Client (command values defined by the application). |
Asynchronous command sending function to the PS Client (a WINC board running the ps_firmware) if the PS client sends any command, it will be received through the @ref M2M_WIFI_RESP_CLIENT_INFO event.
[in] | cmd | Control command sent from PS Server to PS Client (command values defined by the application) |
References hif_send(), M2M_ERR, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_CLIENT_CTRL, NULL, and tstrM2Mservercmd::u8cmd.
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.
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.
Reads the AP information from the Scan Result list with the given index, the response received in wifi_cb M2M_WIFI_RESP_SCAN_RESULT, the response pointer should be casted with tstrM2mWifiscanResult structure.
Synchronous call to read the AP information from the SCAN Result list.
Asynchronous API to request the information of an access point discovered via scanning.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found |
This function allows the information of any discovered access point to be retrieved. When a scan is completed, the application is informed of the number of networks (access points) discovered. Calling this function with an index, N, will return the information for the Nth access point. The information will be returned to the application via a @ref M2M_WIFI_RESP_SCAN_RESULT event, and the response data may be obtained through casting the pointer (pvMsg) to @ref tstrM2mWifiscanResult.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in the response.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found |
Synchronous call to read the AP information from the SCAN Result list with the given index. This function is expected to be called when the response events @ref M2M_WIFI_RESP_SCAN_RESULT or @ref M2M_WIFI_RESP_SCAN_DONE are received in the wi-fi callback function. The response information received can be obtained through the casting to the @ref tstrM2mWifiscanResult structure.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SCAN_RESULT, NULL, and tstrM2mReqScanResult::u8Index.
Initialize the PS Server, The WINC support non secure communication with another WINC, (SERVER/CLIENT) through one byte command (probe request and probe response) without any connection setup.
Synchronous function to initialize the PS Server.
[in] | ch | Server listening channel |
The WINC supports non secure communication with another WINC, (SERVER/CLIENT) through one byte command (probe request and probe response) without any connection setup. The server mode can't be used with any other modes (STA/AP)
[in] | ch | Server listening channel |
References hif_send(), M2M_ERR, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SERVER_INIT, NULL, and tstrM2mServerInit::u8Channel.
sint8 m2m_wifi_request_dhcp_client | ( | void | ) |
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC.
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.
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.
Legacy (deprecated) asynchronous function to start a DHCP client on the WINC.
Dhcp requested by the firmware automatically in STA/AP mode).
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) |
Asynchronous API to request the WINC to scan for networks.
Asynchronous API to request the WINC IC to scan for networks.
Scan statuses are delivered to the application via the Wi-Fi event callback (@ref tpfAppWifiCb) in three stages. The first step involves the event @ref M2M_WIFI_RESP_SCAN_DONE which, if successful, provides the number of detected networks (access points). The application must then read the list of access points via multiple calls to the asynchronous @ref m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event @ref M2M_WIFI_RESP_SCAN_RESULT.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
Scan statuses are delivered to the application via the Wi-Fi event callback (@ref tpfAppWifiCb) in three stages. The first step involves the event @ref M2M_WIFI_RESP_SCAN_DONE which, if successful, provides the number of detected networks (access points). The application must then read the list of access points via multiple calls to the asynchronous @ref m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event @ref M2M_WIFI_RESP_SCAN_RESULT.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
References gu8scanInProgress, hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_SCAN_IN_PROGRESS, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_REQ_SCAN, NULL, and tstrM2MScan::u8ChNum.
Asynchronous wi-fi scan request on the given channel and the hidden scan list.
The scan status is delivered in the wi-fi event callback and then the application is to read the scan results sequentially. The number of APs found (N) is returned in event @ref M2M_WIFI_RESP_SCAN_DONE with the number of found APs. The application could read the list of APs by calling the function @ref m2m_wifi_req_scan_result N times.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels. |
[in] | u8SsidList | u8SsidList is a buffer containing a list of hidden SSIDs to include during the scan. The first byte in the buffer, u8SsidList[0], is the number of SSIDs encoded in the string. The number of hidden SSIDs cannot exceed MAX_HIDDEN_SITES. All SSIDs are concatenated in the following bytes and each SSID is prefixed with a one-byte header containing its length. The total number of bytes in u8SsidList buffer, including length byte, cannot exceed 133 bytes (MAX_HIDDEN_SITES SSIDs x 32 bytes each, which is max SSID length). For instance, encoding the two hidden SSIDs "DEMO_AP" and "TEST" results in the following buffer content: |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
The scan status is delivered in the wi-fi event callback and then the application is to read the scan results sequentially. The number of APs found (N) is returned in event @ref M2M_WIFI_RESP_SCAN_DONE with the number of found APs. The application could read the list of APs by calling the function @ref m2m_wifi_req_scan_result N times.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels. |
[in] | u8SsidList | u8SsidList is a buffer containing a list of hidden SSIDs to include during the scan. The first byte in the buffer, u8SsidList[0], is the number of SSIDs encoded in the string. The number of hidden SSIDs cannot exceed MAX_HIDDEN_SITES. All SSIDs are concatenated in the following bytes and each SSID is prefixed with a one-byte header containing its length. The total number of bytes in u8SsidList buffer, including length byte, cannot exceed 133 bytes (MAX_HIDDEN_SITES SSIDs x 32 bytes each, which is max SSID length). For instance, encoding the two hidden SSIDs "DEMO_AP" and "TEST" results in the following buffer content: |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
References gu8scanInProgress, hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_SCAN_IN_PROGRESS, M2M_MAX_SSID_LEN, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_REQ_SCAN_SSID_LIST, MAX_HIDDEN_SITES, NULL, and tstrM2MScan::u8ChNum.
Asynchronous API to place the WINC into sleep mode for a specified period of time.
API to place the WINC IC into sleep mode for a specified period of time.
Power-save sleep request function, which requests the WINC device to sleep in the currently configured power save mode, as set using @ref m2m_wifi_set_sleep_mode, for a specific time as defined by the parameter u32SlpReqTime (measured in milliseconds). This function should be used when the WINC is running in @ref M2M_PS_MANUAL power save mode only. A wake up request is automatically performed by the WINC device when any host driver API function, e.g. Wi-Fi or socket operation is called.
[in] | u32SlpReqTime | Request sleep time in ms. The best recommended sleep duration is left to be determined by the application. Taking into account that if the application sends notifications very rarely, sleeping for a long time can be a power-efficient decision. In contrast, applications that are sensitive for long periods of absence can experience performance degradation in the connection if long sleeping times are used. |
Synchronous power-save sleep request function, which requests the WINC device to sleep in the currently configured power save mode, as set using @ref m2m_wifi_set_sleep_mode, for a specific time as defined by the passed in parameter. This function should be used in the @ref M2M_PS_MANUAL power save mode only. A wake up request is automatically performed by the WINC device when any host driver API function, e.g. Wi-Fi or socket operation is called.
[in] | u32SlpReqTime | Request sleep time in ms. The best recommended sleep duration is left to be determined by the application. Taking into account that if the application sends notifications very rarely, sleeping for a long time can be a power-efficient decision. In contrast, applications that are sensitive for long periods of absence can experience performance degradation in the connection if long sleeping times are used. |
References hif_get_sleep_mode(), hif_send(), M2M_PS_MANUAL, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DOZE, NULL, and tstrM2mSlpReqTime::u32SleepTime.
sint8 m2m_wifi_send_crl | ( | tstrTlsCrlInfo * | pCRL | ) |
Asynchronous API that notifies the WINC with the Certificate Revocation List.
[in] | pCRL | Pointer to the structure containing certificate revocation list details. |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_SSL, M2M_SSL_IND_CRL, and NULL.
Asynchronous API to queue an Ethernet packet for transmission by the WINC.
Synchronous function to transmit an Ethernet packet.
Transmit a packet directly in ETHERNET/bypass mode where the TCP/IP stack is disabled and the implementation of this packet is left to the application developer. The Ethernet packet composition is left to the application developer.
[in] | pu8Packet | Pointer to a buffer holding the whole Ethernet frame. |
[in] | u16PacketSize | The size of the whole packet in bytes. |
Transmit a packet directly in ETHERNET/bypass mode where the TCP/IP stack is disabled and the implementation of this packet is left to the application developer. The Ethernet packet composition is left to the application developer.
[in] | pu8Packet | Pointer to a buffer holding the whole Ethernet frame. |
[in] | u16PacketSize | The size of the whole packet in bytes. |
References hif_send(), M2M_ETHERNET_HDR_LEN, M2M_ETHERNET_HDR_OFFSET, M2M_HIF_HDR_OFFSET, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SEND_ETHERNET_PACKET, NULL, tstrM2MWifiTxPacketInfo::u16HeaderLength, and tstrM2MWifiTxPacketInfo::u16PacketSize.
Set the battery voltage to update the firmware calculations.
Not implemented in WINC3400 firmware.
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance)
Set the battery voltage to update the firmware calculations.
Not implemented in WINC3400 firmware.
[in] | u16BattVoltx100 | battery voltage multiplied by 100 |
[in] | u16BattVoltx100 | Battery voltage multiplied by 100 |
[in] | u16BattVoltx100 | battery voltage multiplied by 100 |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_BATTERY_VOLTAGE, NULL, and tstrM2mBatteryVoltage::u16BattVolt.
Asynchronous API to add or remove a user-defined Information Element.
API to add or remove a user-defined Information Element.
This function allows the application to provide a custom Information Element to the WINC that will be included in all beacon and probe response frames, while in Access Point mode. If it is required to delete these IEs, fill the buffer with zeros.
[in] | pau8M2mCustInfoElement | Pointer to Buffer containing the IE to be used. It is the application developer's responsibility to ensure on the correctness of the information element's ordering passed in. If the pointer is null, this removes any current custom IE. If non-null, the pointer must reference data in the following format: |
--------------- ---------- ---------- ------------------- -------- -------- ----------- ----------------------- | Byte[0] | Byte[1] | Byte[2] | Byte[3:length1+2] | ..... | Byte[n] | Byte[n+1] | Byte[n+2:lengthx+2] | |---------------|----------|----------|-------------------|-------- --------|-----------|---------------------| | #of all Bytes | IE1 ID | Length1 | Data1(Hex Coded) | ..... | IEx ID | Lengthx | Datax(Hex Coded) | --------------- ---------- ---------- ------------------- -------- -------- ----------- -----------------------
The example demonstrates how the information elements are set using this function.
Synchronous function to Add/Remove user-defined Information Element to the WIFIBeacon and Probe Response frames while chip mode is Access Point Mode.\n According to the information element layout shown bellow, if it is required to set new data for the information elements, pass in the buffer with the information according to the sizes and ordering defined bellow. However, if it's required to delete these IEs, fill the buffer with zeros.
[in] | pau8M2mCustInfoElement | Pointer to Buffer containing the IE to be sent. It is the application developer's responsibility to ensure on the correctness of the information element's ordering passed in. |
--------------- ---------- ---------- ------------------- -------- -------- ----------- ----------------------- | Byte[0] | Byte[1] | Byte[2] | Byte[3:length1+2] | ..... | Byte[n] | Byte[n+1] | Byte[n+2:lengthx+2] | |---------------|----------|----------|-------------------|-------- --------|-----------|---------------------| | #of all Bytes | IE1 ID | Length1 | Data1(Hex Coded) | ..... | IEx ID | Lengthx | Datax(Hex Coded) | --------------- ---------- ---------- ------------------- -------- -------- ----------- -----------------------
The example demonstrates how the information elements are set using this function.
References hif_send(), M2M_CUST_IE_LEN_MAX, M2M_ERR_FAIL, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_CUST_INFO_ELEMENT, and NULL.
Set the WINC3400 device name which is used as P2P device name.
Asynchronous API to set the "Device Name" of the WINC IC.
Sets the WINC device name. The name string is used as a device name in DHCP hostname (option 12).
Asynchronous API to set the Wi-Fi Direct "Device Name" of the WINC.
[in] | pu8DeviceName | Buffer holding the device name. |
[in] | u8DeviceNameLength | Length of the device name. |
Sets the WINC device name. The name string is used as a device name in DHCP hostname (option 12). If a device is not set through this function a default name is assigned. The default name is WINC-XX-YY, where XX and YY are the last 2 octets of the OTP MAC address. If OTP (eFuse) is programmed, then the default name is WINC-00-00.
[in] | pu8DeviceName | Buffer holding the device name. Device name is a null terminated C string. |
[in] | u8DeviceNameLength | Length of the device name. Should not exceed the maximum device name's length M2M_DEVICE_NAME_MAX (including null character). |
Sets the WINC device name. The name string is used as a device name in DHCP hostname (option 12). If a device is not set through this function a default name is assigned. The default name is WINC-XX-YY, where XX and YY are the last 2 octets of the OTP MAC address. If OTP (eFuse) is programmed, then the default name is WINC-00-00.
[in] | pu8DeviceName | Buffer holding the device name. Device name is a null terminated C string. |
[in] | u8DeviceNameLength | Length of the device name. Should not exceed the maximum device name's length M2M_DEVICE_NAME_MAX (including null character). |
References tstrM2MDeviceNameConfig::au8DeviceName, hif_send(), M2M_DEVICE_NAME_MAX, m2m_memcpy(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_DEVICE_NAME, and NULL.
sint8 m2m_wifi_set_lsn_int | ( | tstrM2mLsnInt * | pstrM2mLsnInt | ) |
Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods.
API to set Wi-Fi listen interval for power save operation.
Asynchronous API to set Wi-Fi listen interval for power save operation.
[in] | pstrM2mLsnInt | Structure holding the listen interval configurations. |
This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done by modifying the Wi-Fi listen interval. The listen interval is how many beacon periods the station can sleep before it wakes up to receive data buffered in the AP. It is represented in units of AP beacon periods(100ms).
[in] | pstrM2mLsnInt | Structure holding the listen interval configuration. |
This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done by modifying the Wi-Fi listen interval. The listen interval is how many beacon periods the station can sleep before it wakes up to receive data buffered in the AP. It is represented in units of AP beacon periods(100ms).
[in] | pstrM2mLsnInt | Structure holding the listen interval configuration. |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_LSN_INT, and NULL.
Asynchronous API for assigning a MAC address to the WINC.
Synchronous API for assigning a MAC address to the WINC IC.
This function is intended to allow non-production software to assign a MAC address to the WINC.
[in] | au8MacAddress | MAC Address to be provisioned to the WINC. |
This function override the already assigned MAC address of the WINC board with a user provided one. This is for experimental use only and should never be used in the production SW.
[in] | au8MacAddress | MAC Address to be provisioned to the WINC. |
References tstrM2mSetMacAddress::au8Mac, hif_send(), m2m_memcpy(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_MAC_ADDRESS, and NULL.
Change the power profile mode
Not implemented in WINC3400 firmware.
Change the power profile mode.
[in] | u8PwrMode | Change the WINC power profile to different mode PWR_LOW1/PWR_LOW2/PWR_HIGH/PWR_AUTO (tenuM2mPwrMode) |
[in] | u8PwrMode | Change the WINC power profile to different mode based on the enumeration tenuM2mPwrMode. Not implemented in WINC3400 firmware. |
[in] | u8PwrMode | Change the WINC power profile to different mode PWR_LOW1/PWR_LOW2/PWR_HIGH/PWR_AUTO (tenuM2mPwrMode) |
[in] | u8PwrMode | Change the WINC power profile to different mode based on the enumeration tenuM2mPwrMode. |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_POWER_PROFILE, NULL, and tstrM2mPwrMode::u8PwrMode.
sint8 m2m_wifi_set_scan_options | ( | tstrM2MScanOption * | ptstrM2MScanOption | ) |
Synchronous API for configuring the behaviour of the WINC network scanning functions.
Synchronous API for configuring the behaviour of the WINC IC's network scanning functions.
This function allows the application to tune the scanning behaviour of the WINC using the parameters described in @ref tstrM2MScanOption.
[in] | ptstrM2MScanOption; | Pointer to the structure holding the Scan Parameters. |
This function sets the configuration parameters for the scan operation.
[in] | ptstrM2MScanOption; | Pointer to the structure holding the Scan Parameters. |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_validate_scan_options(), M2M_WIFI_REQ_SET_SCAN_OPTION, and NULL.
Synchronous API for configuring the regulatory restrictions that may affect the WINC scanning behaviour.
Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour.
This function sets a property called the scan region, a parameter that affects the range of channels that the WINC may legally scan given a geographic region. For 2.4GHz, supported in the current release, the requested scan region cannot exceed the maximum number of channels (14).
[in] | ScanRegion | ASIA EUROPE NORTH_AMERICA |
This function sets a property called the scan region, a parameter that affects the range of channels that the WINC IC may legally scan given a geographic region. For 2.4GHz, supported in the current release, the requested scan region can't exceed the maximum number of channels (14).
[in] | ScanRegion | ASIA NORTH_AMERICA |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_SCAN_REGION, NULL, and tstrM2MScanRegion::u16ScanRegion.
Set the power saving mode for the WINC3400.
Synchronous API to set the power-save mode of the WINC IC.
Set the power saving mode for the WINC1500.
Synchronous API to set the power-save mode of the WINC.
[in] | PsTyp | Desired power saving mode. Supported types are defined in tenuPowerSaveModes. |
[in] | BcastEn | Broadcast reception enable flag. If it is 1, the WINC3400 must be awake each DTIM Beacon for receiving Broadcast traffic. If it is 0, the WINC3400 will not wakeup at the DTIM Beacon, but its wakeup depends only on the the configured Listen Interval. |
This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done through one of two ways: - 1) Changing the power save mode, to one of the allowed power save modes (see @ref tenuPowerSaveModes). This is done by setting the first parameter. - 2) Configuring DTIM monitoring: Configuring beacon monitoring parameters by enabling or disabling the reception of broadcast/multicast data. This is done by setting the second parameter.
[in] | PsTyp | Desired power saving mode. Supported types are enumerated in tenuPowerSaveModes. |
[in] | BcastEn | Broadcast reception enable flag. If set to 1, the WINC will wake for each DTIM beacon to ensure broadcast traffic can be received. If set to 0, the WINC will not wakeup at the DTIM beacon, ignoring broadcast traffic, instead it will wake every N beacon periods, as per the negotiated Listen Interval. |
[in] | PsTyp | Desired power saving mode. Supported types are defined in tenuPowerSaveModes. |
[in] | BcastEn | Broadcast reception enable flag. If it is 1, the WINC1500 must be awake each DTIM Beacon for receiving Broadcast traffic. If it is 0, the WINC1500 will not wakeup at the DTIM Beacon, but its wakeup depends only on the the configured Listen Interval. |
This is one of the two synchronous power-save setting functions that allow the host MCU application to tweak the system power consumption. Such tweaking can be done through one of two ways: - 1) Changing the power save mode, to one of the allowed power save modes (see @ref tenuPowerSaveModes). This is done by setting the first parameter. - 2) Configuring DTIM monitoring: Configuring beacon monitoring parameters by enabling or disabling the reception of broadcast/multicast data. This is done by setting the second parameter.
[in] | PsTyp | Desired power saving mode. Supported types are enumerated in tenuPowerSaveModes. |
[in] | BcastEn | Broadcast reception enable flag. If it is 1, the WINC will be awake for each DTIM beacon in order to check for and receive broadcast traffic. If it is 0, the WINC will ignore broadcast traffic. Through this flag the WINC will not wakeup at the DTIM beacon, but instead it will wakeup only based on the configured Listen Interval. |
References hif_send(), hif_set_sleep_mode(), M2M_INFO, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SLEEP, NULL, tstrM2mPsType::u8BcastEn, and tstrM2mPsType::u8PsType.
sint8 m2m_wifi_set_static_ip | ( | tstrM2MIPConfig * | pstrStaticIPConf | ) |
Asynchronous API to manually assign a (static) IP address to the WINC.
Synchronous API to manually assign a (static) IP address to the WINC IC.
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). |
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.
Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scanning functions.
Allows for enabling/disabling of stop scan on first result. When enabled, the WINC will stop the scan as soon as it detects a network and return the results to the host. Setting is persistent and will need to be explicitly reverted back by the application if it no longer wishes for it to be enabled.
[in] | u8StopScanOption; | Setting for enabling or disabling Stopping Scan on first result. 1 = Enabled, 0 = Disabled (Default) |
References hif_send(), M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_INFO, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_STOP_SCAN_OPTION, NULL, and tstrM2MStopScanOption::u8StopOnFirstResult.
Asynchronous function for setting the system time within the WINC.
Function for setting the system time within the WINC IC.
Function for setting the system time in time/date format (@ref uint32). The @ref tstrSystemTime structure can be used as a reference to the time values that should be set and pass its value as @ref uint32.
[in] | u32UTCSeconds | Seconds elapsed since January 1, 1900 (NTP Timestamp). |
Synchronous function for setting the system time in time/date format (@ref uint32). The @ref tstrSystemTime structure can be used as a reference to the time values that should be set and pass its value as @ref uint32.
[in] | u32UTCSeconds | Seconds elapsed since January 1, 1900 (NTP Timestamp). |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_SYS_TIME, and NULL.
set the TX power tenuM2mTxPwrLevel
Set the TX power tenuM2mTxPwrLevel.
[in] | u8TxPwrLevel | change the TX power tenuM2mTxPwrLevel |
[in] | u8TxPwrLevel | Change the TX power based on the enumeration tenuM2mTxPwrLevel. |
[in] | u8TxPwrLevel | change the TX power tenuM2mTxPwrLevel |
[in] | u8TxPwrLevel | Change the TX power based on the enumeration tenuM2mTxPwrLevel. |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_TX_POWER, NULL, and tstrM2mTxPwrLevel::u8TxPwrLevel.
sint8 m2m_wifi_start_provision_mode | ( | tstrM2MAPConfig * | pstrM2MAPConfig, |
char * | pcHttpServerDomainName, | ||
uint8 | bEnableHttpRedirect | ||
) |
Asynchronous API for control of Wi-Fi provisioning functionality.
This function allows the application to start the WINC in 'provisioning mode', a special mode that triggers the WINC to create a Wi-Fi access point, DHCP server, and HTTP server. The HTTP server presents a provisioning page to a connected client which lists the access points detected in the vicinity of the WINC, and allows one of these to be selected and any appropriate credentials to be entered. This allows a headless system to be provisioned (configured to connect with an access point). Provisioning status is returned in an event @ref M2M_WIFI_RESP_PROVISION_INFO.
[in] | pstrAPConfig | AP configuration parameters as defined in tstrM2MAPConfig configuration structure. If a NULL value is passed in, the call will result in a negative error M2M_ERR_FAIL. |
[in] | pcHttpServerDomainName | Domain name of the HTTP Provision WEB server which others will use to load the provisioning Home page. The domain name can have one of the following 3 forms:
|
Forms 1 and 2 are equivalent, they will both start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).
[in] | bEnableHttpRedirect | A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
|
The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.
Asynchronous Wi-Fi provisioning function, which starts the WINC HTTP PROVISIONING mode. The function triggers the WINC to activate the Wi-Fi AP (HOTSPOT) mode with the passed configuration parameters and then starts the HTTP Provision WEB Server. Provisioning status is returned in an event @ref M2M_WIFI_RESP_PROVISION_INFO.
[in] | pstrAPConfig | AP configuration parameters as defined in tstrM2MAPConfig configuration structure. If a NULL value is passed in, the call will result in a negative error M2M_ERR_FAIL. |
[in] | pcHttpServerDomainName | Domain name of the HTTP Provision WEB server which others will use to load the provisioning Home page. The domain name can have one of the following 3 forms:
|
Forms 1 and 2 are equivalent, they will both start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).
[in] | bEnableHttpRedirect | A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
|
The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.
References tstrM2MAPConfigExt::au8DefRouterIP, tstrM2MAPConfig::au8DHCPServerIP, tstrM2MAPConfigExt::au8DNSServerIP, tstrM2MAPConfigExt::au8SubnetMask, m2m_memcpy(), m2m_wifi_start_provision_mode_ext(), tstrM2MAPModeConfig::strApConfig, and tstrM2MAPModeConfig::strApConfigExt.
sint8 m2m_wifi_start_provision_mode_ext | ( | tstrM2MAPModeConfig * | pstrAPModeConfig, |
char * | pcHttpServerDomainName, | ||
uint8 | bEnableHttpRedirect | ||
) |
Asynchronous API for control of Wi-Fi provisioning functionality with extended options.
This function allows the application to start the WINC in 'provisioning mode', a special mode that triggers the WINC to create a Wi-Fi access point, DHCP server, and HTTP server. The HTTP server presents a provisioning page to a connected client which lists the access points detected in the vicinity of the WINC, and allows one of these to be selected and any appropriate credentials to be entered. This allows a headless system to be provisioned (configured to connect with an access point). Provisioning status is returned in an event @ref M2M_WIFI_RESP_PROVISION_INFO.
[in] | pstrAPModeConfig | AP configuration parameters as defined in tstrM2MAPModeConfig configuration structure. A NULL value passed in, will result in a negative error M2M_ERR_FAIL. |
[in] | pcHttpServerDomainName | Domain name of the HTTP Provision WEB server which others will use to load the provisioning Home page. The domain name can have one of the following 3 forms:
|
The forms 1 and 2 are equivalent, they both will start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).
[in] | bEnableHttpRedirect | A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
|
The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.
Asynchronous Wi-Fi provisioning function, which starts the WINC HTTP PROVISIONING mode. The function triggers the WINC to activate the Wi-Fi AP (HOTSPOT) mode with the passed configuration parameters and then starts the HTTP Provision WEB Server. Provisioning status is returned in an event @ref M2M_WIFI_RESP_PROVISION_INFO.
[in] | pstrAPModeConfig | AP configuration parameters as defined in tstrM2MAPModeConfig configuration structure. A NULL value passed in, will result in a negative error M2M_ERR_FAIL. |
[in] | pcHttpServerDomainName | Domain name of the HTTP Provision WEB server which others will use to load the provisioning Home page. The domain name can have one of the following 3 forms:
|
The forms 1 and 2 are equivalent, they both will start a plain http server, while form 3 will start a secure HTTP provisioning Session (HTTP over SSL connection).
[in] | bEnableHttpRedirect | A flag to enable/disable the HTTP redirect feature. If Secure provisioning is enabled (i.e. the server domain name uses "https" prefix) this flag is ignored (no meaning for redirect in HTTPS). Possible values are:
|
The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.
References tstrM2MProvisionModeConfig::acHttpServerDomainName, gu8scanInProgress, hif_send(), M2M_ERR, M2M_ERR_FAIL, M2M_ERR_SEND, m2m_memcpy(), M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, m2m_strlen(), M2M_SUCCESS, m2m_validate_ap_parameters(), M2M_WIFI_REQ_START_PROVISION_MODE, M2M_WIFI_REQ_START_PROVISION_MODE_LEGACY, NULL, tstrM2MAPModeConfig::strApConfig, tstrM2MProvisionModeConfig::strApConfig, tstrM2MAPModeConfig::strApConfigExt, tstrM2MProvisionModeConfig::strApConfigExt, and tstrM2MProvisionModeConfig::u8EnableRedirect.
sint8 m2m_wifi_stop_provision_mode | ( | void | ) |
Synchronous API for terminating provisioning mode on the WINC.
Synchronous API for terminating provisioning mode on the WINC IC.
This function will terminate any currently active provisioning mode on the WINC, returning the WINC to idle.
This function will terminate any currently active provisioning mode on the WINC IC, returning the IC to idle.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_STOP_PROVISION_MODE, and NULL.
Asynchronous API to engage the WINC Wi-Fi Protected Setup (enrollee) function.
Asynchronous API to engage the WINC IC's Wi-Fi Protected Setup (enrollee) function.
This function can be called to make the WINC enter WPS (Wi-Fi Protected Setup) mode. The result is passed to the Wi-Fi notification callback with the event @ref M2M_WIFI_REQ_WPS.
[in] | u8TriggerType | WPS Trigger method. This may be:
|
[in] | pcPinNumber | Valid only if the u8TriggerType is WPS_PIN_TRIGGER, this parameter contains the PIN number. The number must follow the format as given in the WSC1.0 specification. |
The code snippet shows an example of how wi-fi WPS is triggered .
This function is called for the WINC to enter the WPS (Wi-Fi Protected Setup) mode. The result is passed to the Wi-Fi notification callback with the event @ref M2M_WIFI_REQ_WPS.
[in] | u8TriggerType | WPS Trigger method. This may be:
|
[in] | pcPinNumber | PIN number for WPS PIN method. It is not used if the trigger type is WPS_PBC_TRIGGER. It must follow the rules stated by the WPS standard. |
The code snippet shows an example of how wi-fi WPS is triggered .
References tstrM2MWPSConnect::acPinNumber, gu8scanInProgress, hif_send(), m2m_memcpy(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_WPS, NULL, tstrM2MWPSConnect::u8TriggerType, and WPS_PIN_TRIGGER.
sint8 m2m_wifi_wps_disable | ( | void | ) |
Asynchronous API that disables Wi-Fi Protected Setup mode in the WINC.
Stops the ongoing WPS session.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DISABLE_WPS, and NULL.
void m2m_wifi_yield | ( | void | ) |
Yield from processing more synchronous M2M events.
This function causes the synchronous M2M event handler function to yield from processing further events and return control to the caller.
References hif_yield().
|
static |
|
static |
Referenced by m2m_wifi_cb(), and m2m_wifi_init_start().
|
static |
|
static |
Referenced by m2m_wifi_cb(), and m2m_wifi_get_num_ap_found().
|
static |
|
static |
Referenced by m2m_wifi_deinit(), m2m_wifi_download_mode(), m2m_wifi_get_state(), m2m_wifi_init_hold(), and m2m_wifi_init_start().