Functions | |
NMI_API sint8 | m2m_wifi_ble_api_send (uint8 *msg, uint32 len) |
NMI_API sint8 | m2m_wifi_ble_set_gain_table (uint8 table_idx) |
Asynchronous API that notifies the WINC with the Gain Table index from Flash that should use to configure the WiFi and BLE gains. More... | |
NMI_API sint8 | m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch) |
Asynchronous API to request connection to a specified access point. More... | |
NMI_API sint8 | m2m_wifi_connect_sc (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch, uint8 u8SaveCred) |
Asynchronous API to request connection to a specific AP with option to store credentials in flash. More... | |
NMI_API sint8 | m2m_wifi_default_connect (void) |
Asynchronous API that attempts to reconnect to the last-associated access point. More... | |
NMI_API sint8 | m2m_wifi_deinit (void *arg) |
Synchronous API that de-initialises the WINC driver. More... | |
NMI_API sint8 | m2m_wifi_disable_ap (void) |
Synchronous API to disable access point mode on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_disable_monitoring_mode (void) |
Asynchronous API to disable Wi-Fi monitoring (promiscuous receive) mode. More... | |
NMI_API sint8 | m2m_wifi_disconnect (void) |
Synchronous API to request disconnection from a network. More... | |
NMI_API sint8 | m2m_wifi_download_mode (void) |
Synchronous API that prepares the WINC IC to enter firmware or certificate download mode. More... | |
NMI_API sint8 | m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_enable_dhcp (uint8 u8DhcpEn) |
Asynchronous function to control the DHCP client functionality within the WINC IC. 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... | |
NMI_API sint8 | m2m_wifi_enable_mac_mcast (uint8 *pu8MulticastMacAddress, uint8 u8AddRemove) |
Asynchronous API to add or remove MAC addresses in the multicast filter. More... | |
NMI_API sint8 | m2m_wifi_enable_monitoring_mode (tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer, uint16 u16BufferSize, uint16 u16DataOffset) |
Asynchronous call to enable Wi-Fi monitoring (promiscuous receive) mode. More... | |
NMI_API sint8 | m2m_wifi_enable_sntp (uint8 bEnable) |
Asynchronous API to enable or disable the SNTP client running on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_get_connection_info (void) |
Asynchronous API for retrieving the WINC IC's connection status. More... | |
NMI_API sint8 | m2m_wifi_get_mac_address (uint8 *pu8MacAddr) |
Synchronous API to retrieve the MAC address currently in use on the device. More... | |
NMI_API uint8 | m2m_wifi_get_num_ap_found (void) |
Synchronous API to retrieve the number of AP's found during the last scan operation. More... | |
NMI_API sint8 | m2m_wifi_get_otp_mac_address (uint8 *pu8MacAddr, uint8 *pu8IsValid) |
Synchronous API to query the MAC address programmed into the WINC ICs OTP memory. More... | |
NMI_API uint8 | m2m_wifi_get_sleep_mode (void) |
Synchronous API to retrieve the current power save mode of the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_get_sytem_time (void) |
Asynchronous API to obtain the system time in use by the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_handle_events (void *arg) |
Synchronous M2M event handler function. More... | |
NMI_API sint8 | m2m_wifi_init (tstrWifiInitParam *pWifiInitParam) |
Synchronous API that initialises the WINC driver. More... | |
sint8 | m2m_wifi_init_hold (void) |
First part of m2m_wifi_init, up to the point of initializing spi for flash access. More... | |
sint8 | m2m_wifi_init_start (tstrWifiInitParam *param) |
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off. More... | |
NMI_API sint8 | m2m_wifi_p2p (uint8 u8Channel) |
Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_p2p_disconnect (void) |
Synchronous API to disable Wi-Fi Direct (P2P) Mode on the WINC IC. More... | |
sint8 | m2m_wifi_reinit (tstrWifiInitParam *param) |
Deinitialize and reinitialize wifi. Resets the WINC. Parameter may be set to NULL, in which case there is no change to the parameters given at initialization. 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 *param) |
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off. More... | |
NMI_API sint8 | m2m_wifi_req_curr_rssi (void) |
Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection. More... | |
NMI_API sint8 | m2m_wifi_req_restrict_ble (void) |
Asynchronous API to request restricting of BLE functionality by placing the BLE processor in a low power state. It is recommended to do this if it is know that BLE functionality will not be used for any significant length of time. More... | |
NMI_API sint8 | m2m_wifi_req_scan_result (uint8 index) |
Asynchronous API to request the information of an access point discovered via scanning. More... | |
NMI_API sint8 | m2m_wifi_req_unrestrict_ble (void) |
Asynchronous API to request un-restricting of BLE functionality by reverting the BLE processor to full power mode. More... | |
NMI_API sint8 | m2m_wifi_request_dhcp_client (void) |
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_request_dhcp_server (uint8 *addr) |
Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_request_scan (uint8 ch) |
Asynchronous API to request the WINC IC perform a scan for networks. More... | |
sint8 | m2m_wifi_request_scan_passive (uint8 ch) |
NMI_API sint8 | m2m_wifi_request_sleep (uint32 u32SlpReqTime) |
Asynchronous API to place the WINC IC into sleep mode for a specified period of time. More... | |
NMI_API sint8 | m2m_wifi_send_ethernet_pkt (uint8 *pu8Packet, uint16 u16PacketSize) |
Asynchronous API to queue an Ethernet packet for transmission by the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_send_wlan_pkt (uint8 *pu8WlanPacket, uint16 u16WlanHeaderLength, uint16 u16WlanPktSize) |
Asynchronous API to queue a raw Wi-Fi packet for transmission by the WINC IC. More... | |
sint8 | m2m_wifi_set_battery_voltage (uint16 u16BattVoltx100) |
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance) More... | |
NMI_API sint8 | m2m_wifi_set_cust_InfoElement (uint8 *pau8M2mCustInfoElement) |
Asynchronous API to add or remove a user-defined Information Element. More... | |
NMI_API sint8 | m2m_wifi_set_device_name (uint8 *pu8DeviceName, uint8 u8DeviceNameLength) |
Asynchronous API to set the Wi-Fi Direct "Device Name" of the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt) |
Asynchronous API to set Wi-Fi listen interval for power save operation. More... | |
NMI_API sint8 | m2m_wifi_set_mac_address (uint8 au8MacAddress[6]) |
Synchronous API for assigning a MAC address to the WINC IC. More... | |
sint8 | m2m_wifi_set_power_profile (uint8 u8PwrMode) |
Change the power profile mode. More... | |
NMI_API sint8 | m2m_wifi_set_receive_buffer (void *pvBuffer, uint16 u16BufferLen) |
Asynchronous API to set or change the size of the WINC IC's receive buffer. More... | |
NMI_API sint8 | m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption) |
Synchronous API for configuring the behaviour of the WINC IC's network scanning functions. More... | |
NMI_API sint8 | m2m_wifi_set_scan_region (uint16 ScanRegion) |
Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour. More... | |
NMI_API sint8 | m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn) |
Synchronous API to set the power-save mode of the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf) |
Synchronous API to manually assign a (static) IP address to the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_set_sytem_time (uint32 u32UTCSeconds) |
Asynchronous function for setting the system time within the WINC IC. More... | |
sint8 | m2m_wifi_set_tx_power (uint8 u8TxPwrLevel) |
set the TX power tenuM2mTxPwrLevel More... | |
NMI_API sint8 | m2m_wifi_start_provision_mode (tstrM2MAPConfig *pstrAPConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect) |
Asynchronous API for control of Wi-Fi provisioning functionality. More... | |
NMI_API sint8 | m2m_wifi_stop_provision_mode (void) |
Synchronous API for terminating provisioning mode on the WINC IC. More... | |
NMI_API sint8 | m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber) |
Asynchronous API to engage the WINC IC's Wi-Fi Protected Setup (enrolee) function. More... | |
NMI_API sint8 | m2m_wifi_wps_disable (void) |
Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC. More... | |
NMI_API void | m2m_wifi_yield (void) |
Yield from processing more synchronous M2M events. More... | |
Definition at line 1479 of file m2m_wifi.c.
Asynchronous API that notifies the WINC with the Gain Table index from Flash that should use to configure the WiFi and BLE gains.
Definition at line 451 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_connect | ( | char * | pcSsid, |
uint8 | u8SsidLen, | ||
uint8 | u8SecType, | ||
void * | pvAuthInfo, | ||
uint16 | u16Ch | ||
) |
Asynchronous API to request connection to a specified access point.
Prior to a successful connection, the application developers must know the SSID, the security type, and the authentication parameters of the target access point; knowledge of the channel number is optional.
The connection status will be indicated to the application via a M2M_WIFI_RESP_CON_STATE_CHANGED event. The status will be one of those defined in tenuM2mConnState withe M2M_WIFI_CONNECTED indicating a successful connection.
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. |
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL. |
[in] | 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. It is type is based on the security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure. |
[in] | 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 (255). 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.
Definition at line 577 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_connect_sc | ( | char * | pcSsid, |
uint8 | u8SsidLen, | ||
uint8 | u8SecType, | ||
void * | pvAuthInfo, | ||
uint16 | u16Ch, | ||
uint8 | u8SaveCred | ||
) |
Asynchronous API to request connection to a specific AP with option to store credentials in flash.
Prior to a successful connection, the application developers must know the SSID, the security type, and the authentication parameters of the target access point; knowledge of the channel number is optional.
The connection status will be indicated to the application via a M2M_WIFI_RESP_CON_STATE_CHANGED event. The status will be one of those defined in tenuM2mConnState withe M2M_WIFI_CONNECTED indicating a successful connection.
The only difference between this function and m2m_wifi_connect, is the option to save the acess point info ( SSID, password...etc) into flash.
[in] | pcSsid | A buffer holding the SSID corresponding to the requested AP. |
[in] | u8SsidLen | Length of the given SSID (not including the NULL termination). A length less than ZERO or greater than the maximum defined SSID M2M_MAX_SSID_LEN will result in a negative error M2M_ERR_FAIL. |
[in] | 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. It is type is based on the security type. If the authentication parameters are NULL or are greater than the maximum length of the authentication parameters length as defined by M2M_MAX_PSK_LEN a negative error will return M2M_ERR_FAIL(-12) indicating connection failure. |
[in] | 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 (255). 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 acess point SSID and password into the WINC flash memory or not. |
Definition at line 581 of file m2m_wifi.c.
Asynchronous API that attempts to reconnect to the last-associated access point.
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 M2M_WIFI_RESP_DEFAULT_CONNECT indicating a connection error as defined in the structure tstrM2MDefaultConnResp.
Possible errors are:
Definition at line 572 of file m2m_wifi.c.
Synchronous API that de-initialises the WINC driver.
This disables the host interface and frees any resources used by the M2M_WIFI layer. The function must be called in the during the final phases of closing the application to ensure that all resources have been correctly released.
[in] | arg | Opaque argument, not used in current implementation. Application should use null. |
Definition at line 534 of file m2m_wifi.c.
Synchronous API to disable access point mode on the WINC IC.
Definition at line 890 of file m2m_wifi.c.
Asynchronous API to disable Wi-Fi monitoring (promiscuous receive) mode.
Synchronous API to request disconnection from a network.
This function will cause the WINC IC to disconnect from any currently connected access point.
Definition at line 693 of file m2m_wifi.c.
NMI_API void m2m_wifi_download_mode | ( | void | ) |
Synchronous API that prepares the WINC IC to enter firmware or certificate download mode.
The WINC board is prepared for download, through initializations for the WINC driver including bus initializations and interrupt enabling, it also halts the chip, to allow for the firmware downloads. Firmware can be downloaded through a number of interfaces, UART, I2C and SPI.
Definition at line 322 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_enable_ap | ( | CONST tstrM2MAPConfig * | pstrM2MAPConfig | ) |
Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC IC.
The WINC IC supports the ability to operate as an access point with the limitation that:
[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.
Definition at line 881 of file m2m_wifi.c.
Asynchronous function to control the DHCP client functionality within the WINC IC.
This function allows the application to control the behaviour of the DHCP client function within the WINC IC 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:
|
Definition at line 738 of file m2m_wifi.c.
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 |
Definition at line 1346 of file m2m_wifi.c.
Asynchronous API to add or remove MAC addresses in the multicast filter.
This function allows the application to configure the capability of the WINC IC to receive multicast packets when operating in bypass mode.
[in] | pu8MulticastMacAddress | Pointer to MAC address |
[in] | u8AddRemove | A flag to add or remove the MAC ADDRESS, based on the following values:
|
NMI_API sint8 m2m_wifi_enable_monitoring_mode | ( | tstrM2MWifiMonitorModeCtrl * | pstrMtrCtrl, |
uint8 * | pu8PayloadBuffer, | ||
uint16 | u16BufferSize, | ||
uint16 | u16DataOffset | ||
) |
Asynchronous call to enable Wi-Fi monitoring (promiscuous receive) mode.
This function places the reciver into a mode where all frames (or those matching a set of filter criteria) received on air are passed to the application.
A dedicated callback function, tpfAppMonCb, must be registered to handle frames received in promiscuous mode. This is done via an instance of a tstrWifiInitParam structure and a call to the m2m_wifi_init function.
[in] | pstrMtrCtrl | Pointer to tstrM2MWifiMonitorModeCtrl structure holding the Filtering parameters. |
[in] | pu8PayloadBuffer | Pointer to a Buffer allocated by the application. The buffer SHALL hold the Data field of the WIFI RX Packet (Or a part from it). If it is set to NULL, the WIFI data payload will be discarded by the monitoring driver. |
[in] | u16BufferSize | The total size of the pu8PayloadBuffer in bytes. |
[in] | u16DataOffset | Starting offset in the DATA FIELD of the received WIFI packet. The application may be interested in reading specific information from the received packet. It must assign the offset to the starting position of it relative to the DATA payload start. Example, if the SSID is needed to be read from a PROBE REQ packet, the u16Offset MUST be set to 0. |
The example demonstrates the main function where-by the monitoring enable function is called after the initialization of the driver and the packets are handled in the callback function.
Asynchronous API to enable or disable the SNTP client running on the WINC IC.
The SNTP client is enabled by default during chip initialisation. This function can be used to disable or subsequently re-enable the service.
The service is capable of syncrhonising the WINC's 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 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 IC's time may be set using the m2m_wifi_set_sytem_time function.
[in] | bEnable | Enables or disables the SNTP service
|
Definition at line 1290 of file m2m_wifi.c.
sint8 m2m_wifi_get_connection_info | ( | void | ) |
Asynchronous API for retrieving the WINC IC's connection status.
Requests the connection status from the WINC IC 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 notifiction callback and the event M2M_WIFI_RESP_CONN_INFO.
The connection info can be retrieved using the structure tstrM2MConnInfo which contains:
The code snippet shows an example of how wi-fi connection information is retrieved .
Definition at line 1268 of file m2m_wifi.c.
Synchronous API to retrieve the MAC address currently in use on the device.
Request the current MAC address of the device (the working mac address). (the function is Blocking until response received)
This function obtains the MAC address that is currently in use by the device. If the function returns with 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 MEM_SUCCESS) |
[out] | pu8MacAddr | Output MAC address buffer of 6 bytes size. |
Definition at line 975 of file m2m_wifi.c.
Synchronous API to retrieve the number of AP's found during the last scan operation.
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.
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 M2M_WIFI_RESP_SCAN_DONE event.
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.
Definition at line 1027 of file m2m_wifi.c.
Synchronous API to query the MAC address programmed into the WINC ICs OTP memory.
Request the MAC address stored on the OTP (one time programmable) memory of the device. (the function is Blocking until response received)
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 are returned via RAM pointed to by the input arguments.
[out] | pu8MacAddr | Output MAC address buffer 6 bytes in size. This is valid only if *pu8Valid equals 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. |
[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. |
Definition at line 951 of file m2m_wifi.c.
Synchronous API to retrieve the current power save mode of the WINC IC.
Get the current Power save mode.
Definition at line 1037 of file m2m_wifi.c.
Asynchronous API to obtain the system time in use by the WINC IC.
This function will request that the WINC IC send it's current system time to the application. The information will arrive at the application via the tpfAppWifiCb and event M2M_WIFI_RESP_GET_SYS_TIME.
Definition at line 1285 of file m2m_wifi.c.
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.
Definition at line 567 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_init | ( | tstrWifiInitParam * | pWifiInitParam | ) |
Synchronous API that initialises the WINC driver.
This function initializes the driver by registering the call back function for M2M_WIFI layer (also the call back 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.
Following are the possible Wi-Fi events that are expected to be received through the callback function (provided by the application):
Any application using the WINC driver must call this function at the start of its main function.
[in] | pWifiInitParam | This is a pointer to the tstrWifiInitParam structure which contains pointers to the application WIFI layer callback, monitoring mode callback and tstrEthInitParam structure (which contains initialisation settings for bypass mode). |
Definition at line 523 of file m2m_wifi.c.
sint8 m2m_wifi_init_hold | ( | void | ) |
First part of m2m_wifi_init, up to the point of initializing spi for flash access.
Definition at line 463 of file m2m_wifi.c.
sint8 m2m_wifi_init_start | ( | tstrWifiInitParam * | param | ) |
Second part of m2m_wifi_init, continuing from where m2m_wifi_init_hold left off.
[in] | param | Structure containing configration details |
Definition at line 472 of file m2m_wifi.c.
Asynchronous API for enabling Wi-Fi Direct (P2P) mode in the WINC IC.
[in] | u8Channel | P2P Listen RF channel. |
The code snippet shows an example of how the p2p mode operates.
Definition at line 859 of file m2m_wifi.c.
Synchronous API to disable Wi-Fi Direct (P2P) Mode on the WINC IC.
Definition at line 875 of file m2m_wifi.c.
sint8 m2m_wifi_reinit | ( | tstrWifiInitParam * | param | ) |
Deinitialize and reinitialize wifi. Resets the WINC. Parameter may be set to NULL, in which case there is no change to the parameters given at initialization.
Definition at line 552 of file m2m_wifi.c.
sint8 m2m_wifi_reinit_hold | ( | void | ) |
First part of m2m_wifi_reinit, up to the point of initializing spi for flash access.
Definition at line 543 of file m2m_wifi.c.
sint8 m2m_wifi_reinit_start | ( | tstrWifiInitParam * | param | ) |
Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off.
Definition at line 548 of file m2m_wifi.c.
Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection.
Request the current RSSI for the current connected AP, the response received in wifi_cb M2M_WIFI_RESP_CURRENT_RSSI.
This function will result in the application receiving the RSSI via a 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 event received in the callback.
Definition at line 903 of file m2m_wifi.c.
Asynchronous API to request restricting of BLE functionality by placing the BLE processor in a low power state. It is recommended to do this if it is know that BLE functionality will not be used for any significant length of time.
Definition at line 910 of file m2m_wifi.c.
Asynchronous API to request the information of an access point discovered via scanning.
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.
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 M2M_WIFI_RESP_SCAN_RESULT event, and the response data may be obtained through casting the pointer (pvMsg) to 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 response.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found |
Definition at line 1007 of file m2m_wifi.c.
Asynchronous API to request un-restricting of BLE functionality by reverting the BLE processor to full power mode.
Definition at line 917 of file m2m_wifi.c.
Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC IC.
This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC IC.
Definition at line 717 of file m2m_wifi.c.
Legacy (deprecated) Asynchronous function to start a DHCP client on the WINC IC.
This is a legacy API and is no longer supported. Calls to this API will not result in any changes being made to the state of the WINC IC.
[in] | addr | The address to issue to a connected client (only one client is supported) |
Definition at line 722 of file m2m_wifi.c.
Asynchronous API to request the WINC IC perform a scan for networks.
Scan statuses are delivered to the application via the Wi-Fi event callback (tpfAppWifiCb) in three stages. The first step involves the event 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 m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event 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.
Definition at line 775 of file m2m_wifi.c.
[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. |
Definition at line 792 of file m2m_wifi.c.
Asynchronous API to place the WINC IC into sleep mode for a specified period of time.
This function allows a WINC IC that is running in M2M_PS_MANUAL mode to be placed into sleep state for a specified period of time (measured in milliseconds).
[in] | u32SlpReqTime | The time in ms that the WINC IC should sleep for |
Definition at line 1075 of file m2m_wifi.c.
Asynchronous API to queue an Ethernet packet for transmission by the WINC IC.
[in] | pu8Packet | Pointer to a buffer holding the whole Ethernet frame. |
[in] | u16PacketSize | The size of the whole bytes in packet. |
Definition at line 924 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_send_wlan_pkt | ( | uint8 * | pu8WlanPacket, |
uint16 | u16WlanHeaderLength, | ||
uint16 | u16WlanPktSize | ||
) |
Asynchronous API to queue a raw Wi-Fi packet for transmission by the WINC IC.
[in] | pu8WlanPacket | Pointer to a buffer holding the whole WIFI frame. |
[in] | u16WlanHeaderLength | The size of the WIFI packet header ONLY. |
[in] | u16WlanPktSize | The size of the whole bytes in packet. |
Enable or Disable logs in run time (Disable Firmware logs will enhance the firmware start-up time and performance)
[in] | u16BattVoltx100 | battery voltage multiplied by 100 |
Definition at line 1366 of file m2m_wifi.c.
Asynchronous API to add or remove a user-defined Information Element.
This function allows the application to provide a custom Information Element to the WINC IC that will be included in all beacon and probe response frames.
[in] | pau8M2mCustInfoElement | Pointer to Buffer containing the IE to be used. If 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.
Definition at line 753 of file m2m_wifi.c.
Asynchronous API to set the Wi-Fi Direct "Device Name" of the WINC IC.
Set the WINC3400 device name which is used as P2P device name.
[in] | pu8DeviceName | Buffer holding the device name. |
[in] | u8DeviceNameLength | Length of the device name. Should not exceed the maximum device name's length M2M_DEVICE_NAME_MAX. |
[in] | pu8DeviceName | Buffer holding the device name. |
[in] | u8DeviceNameLength | Length of the device name. |
Definition at line 1098 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_set_lsn_int | ( | tstrM2mLsnInt * | pstrM2mLsnInt | ) |
Asynchronous API to set Wi-Fi listen interval for power save operation.
Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods.
[in] | pstrM2mLsnInt | Structure holding the listen interval configurations. |
[in] | pstrM2mLsnInt | Structure holding the listen interval configurations. |
Definition at line 748 of file m2m_wifi.c.
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 IC.
[in] | au8MacAddress | MAC Address to be provisioned to the WINC. |
Definition at line 697 of file m2m_wifi.c.
Change the power profile mode.
[in] | u8PwrMode | Change the WINC power profile to one of the modes: PWR_LOW1, PWR_LOW2, PWR_HIGH, PWR_AUTO. |
[in] | u8PwrMode | Change the WINC power profile to different mode PWR_LOW1/PWR_LOW2/PWR_HIGH/PWR_AUTO (tenuM2mPwrMode) |
Definition at line 1308 of file m2m_wifi.c.
Asynchronous API to set or change the size of the WINC IC's receive buffer.
[in] | pvBuffer | Pointer to Buffer to receive data. A NULL pointer causes a negative error M2M_ERR_FAIL. |
[in] | u16BufferLen | Length of data to be received. Maximum length of data should not exceed the size defined by TCP/IP defined as SOCKET_BUFFER_MAX_LENGTH |
sint8 m2m_wifi_set_scan_options | ( | tstrM2MScanOption * | ptstrM2MScanOption | ) |
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 IC using the parameters described in tstrM2MScanOption.
[in] | ptstrM2MScanOption; | Pointer to the structure holding the Scan Parameters. |
Definition at line 758 of file m2m_wifi.c.
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 IC may legally scan given a geographic region.
[in] | ScanRegion |
Definition at line 767 of file m2m_wifi.c.
Synchronous API to set the power-save mode of the WINC IC.
Set the power saving mode for the WINC3400.
[in] | PsTyp | Desired power saving mode. Supported types are defined in tenuPowerSaveModes. |
[in] | BcastEn | Broadcast reception enable flag.
|
[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. |
Definition at line 1055 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_set_static_ip | ( | tstrM2MIPConfig * | pstrStaticIPConf | ) |
Synchronous API to manually assign a (static) IP address to the WINC IC.
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 and the application knows the specifics of the network.
[in] | pstrStaticIPConf | Pointer to a structure holding the static IP Configurations (IP, Gateway, subnet mask and DNS address). |
Definition at line 705 of file m2m_wifi.c.
Asynchronous function for setting the system time within the WINC IC.
[in] | u32UTCSeconds | UTC value in seconds. |
Definition at line 1273 of file m2m_wifi.c.
set the TX power tenuM2mTxPwrLevel
[in] | u8TxPwrLevel | change the TX power tenuM2mTxPwrLevel |
[in] | u8TxPwrLevel | change the TX power tenuM2mTxPwrLevel |
Definition at line 1326 of file m2m_wifi.c.
NMI_API sint8 m2m_wifi_start_provision_mode | ( | tstrM2MAPConfig * | pstrAPConfig, |
char * | pcHttpServerDomainName, | ||
uint8 | bEnableHttpRedirect | ||
) |
Asynchronous API for control of Wi-Fi provisioning functionality.
This function allows the application to start the WINC IC 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 a M2M_WIFI_RESP_PROVISION_INFO event.
[in] | pstrAPConfig | AP configuration parameters as defined in tstrM2MAPConfig 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. For example "wincconf.net". |
[in] | bEnableHttpRedirect | A flag to enable/disable the HTTP redirect feature. Possible values are:
|
The example demonstrates a code snippet for how provisioning is triggered and the response event received accordingly.
Definition at line 1233 of file m2m_wifi.c.
sint8 m2m_wifi_stop_provision_mode | ( | void | ) |
Synchronous API for terminating provisioning mode on the WINC IC.
This function will terminate any currently active provisioning mode on the WINC IC, returning the IC to idle.
Definition at line 1263 of file m2m_wifi.c.
Asynchronous API to engage the WINC IC's Wi-Fi Protected Setup (enrolee) 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 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 wifi WPS is triggered .
Definition at line 809 of file m2m_wifi.c.
Synchronous API that disables Wi-Fi Protected Setup mode in the WINC IC.
Definition at line 820 of file m2m_wifi.c.
NMI_API 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.
Definition at line 562 of file m2m_wifi.c.