Microchip® Advanced Software Framework

winc1500/host_drv/driver/include/m2m_wifi.h File Reference

WINC WLAN Application Interface.

Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include "common/include/nm_common.h"
#include "driver/include/m2m_types.h"
#include "driver/source/nmdrv.h"

Data Structures

struct  tstr1xAuthCredentials
 
struct  tstrAuth1xMschap2
 
struct  tstrAuth1xTls
 
struct  tstrAuthPsk
 
struct  tstrAuthWep
 
struct  tstrEthInitParam
 Structure to hold Ethernet interface parameters. Structure is to be defined and have its attributes set, based on the application's functionality before a call is made to initialize the wi-fi operations by calling the m2m_wifi_init function. Part of the wi-fi configuration structure tstrWifiInitParam. Applications shouldn't need to define this structure, if the bypass mode is not defined. More...
 
struct  tstrM2mIpCtrlBuf
 Structure holding the incoming buffer's data size information, indicating the data size of the buffer and the remaining buffer's data size. The data of the buffer which holds the packet sent to the host when in the bypass mode, is placed in the tstrEthInitParam::au8ethRcvBuf attribute. This following information is retrieved in the host when an event M2M_WIFI_RESP_ETHERNET_RX_PACKET is received in the Wi-Fi callback function tpfAppWifiCb. More...
 
struct  tstrM2mWifiWepParams
 
struct  tstrNetworkId
 
struct  tstrWifiInitParam
 
Structure, holding the Wi-fi configuration attributes such as the wi-fi callback , monitoring mode callback and Ethernet parameter initialization structure.
More...
 

Typedefs

typedef void(* tpfAppEthCb )(uint8 u8MsgType, void *pvMsg, void *pvCtrlBuf)
 
typedef void(* tpfAppWifiCb )(uint8 u8MsgType, void *pvMsg)
 

Enumerations

enum  tenu1xOption {
  WIFI_1X_BYPASS_SERVER_AUTH,
  WIFI_1X_TIME_VERIF_MODE,
  WIFI_1X_SESSION_CACHING,
  WIFI_1X_SPECIFIC_ROOTCERT,
  WIFI_1X_BYPASS_SERVER_AUTH,
  WIFI_1X_SESSION_CACHING,
  WIFI_1X_SPECIFIC_ROOTCERT,
  WIFI_1X_TIME_VERIF_MODE
}
 
enum  tenuCredStoreOption {
  WIFI_CRED_DONTSAVE,
  WIFI_CRED_SAVE_UNENCRYPTED,
  WIFI_CRED_SAVE_ENCRYPTED,
  WIFI_CRED_DONTSAVE,
  WIFI_CRED_SAVE_UNENCRYPTED,
  WIFI_CRED_SAVE_ENCRYPTED
}
 
enum  tenuWifiState {
  WIFI_STATE_DEINIT,
  WIFI_STATE_INIT,
  WIFI_STATE_START,
  WIFI_STATE_DEINIT,
  WIFI_STATE_INIT,
  WIFI_STATE_START
}
 

Functions

sint8 m2m_wifi_1x_get_option (tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen)
 API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication. More...
 
sint8 m2m_wifi_1x_set_option (tenu1xOption enuOptionName, const void *pOptionValue, size_t OptionLen)
 API to set (write) options relating to Wi-Fi connection using WPA(2) Enterprise authentication. More...
 
NMI_API sint8 m2m_wifi_conf_auto_rate (tstrConfAutoRate *pstrConfAutoRate)
 Allow the host MCU app to configure auto TX rate selection algorithm. The application can use this API to tweak the algorithm performance. Moreover, it allows the application to force a specific WLAN PHY rate for transmitted data packets to favor range vs. throughput needs. More...
 
NMI_API sint8 m2m_wifi_configure_sntp (uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP)
 Configures what NTP server the SNTP client should use. More...
 
NMI_API sint8 m2m_wifi_connect (char *pcSsid, uint8 u8SsidLen, uint8 u8SecType, void *pvAuthInfo, uint16 u16Ch)
 Legacy asynchronous API to request connection to a specified access point. More...
 
sint8 m2m_wifi_connect_1x_mschap2 (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xMschap2 *pstrAuth1xMschap2)
 Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials. More...
 
sint8 m2m_wifi_connect_1x_tls (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuth1xTls *pstrAuth1xTls)
 Asynchronous API to connect to an access point using WPA(2) Enterprise authentication with MS-CHAP-V2 credentials. More...
 
sint8 m2m_wifi_connect_open (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId)
 Asynchronous API to connect to an access point using open authentication. More...
 
sint8 m2m_wifi_connect_psk (tenuCredStoreOption enuCredStoreOption, tstrNetworkId *pstrNetworkId, tstrAuthPsk *pstrAuthPsk)
 Asynchronous API to connect to an access point using WPA(2) PSK authentication. More...
 
NMI_API 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...
 
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 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...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_disconnect (void)
 Synchronous API to request disconnection from a network. More...
 
NMI_API sint8 m2m_wifi_download_mode (void)
 Prepares the WINC before downloading any data (Firmware, Certificates, etc). More...
 
NMI_API sint8 m2m_wifi_enable_ap (CONST tstrM2MAPConfig *pstrM2MAPConfig)
 Asynchronous API to enable access point (AKA "hot-spot") mode on the WINC. More...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API 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_enable_XO_during_sleep (uint8 bXOSleepEnable)
 Specifies whether the crystal oscillator is left on or off during deep sleep (defaults to off). More...
 
NMI_API sint8 m2m_wifi_get_connection_info (void)
 Asynchronous API for retrieving the WINC connection status. More...
 
NMI_API sint8 m2m_wifi_get_firmware_version (tstrM2mRev *pstrRev)
 Synchronous API to obtain the firmware version currently running on the WINC IC. More...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API uint8 m2m_wifi_get_sleep_mode (void)
 Get the current Power save mode. More...
 
NMI_API uint8 m2m_wifi_get_state (void)
 Get the wifi state. More...
 
NMI_API sint8 m2m_wifi_get_system_time (void)
 Asynchronous API to obtain the system time in use by the WINC. 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 to initialize the WINC driver. More...
 
NMI_API sint8 m2m_wifi_init_hold (void)
 First part of m2m_wifi_init, up to the point of initializing SPI for flash access. More...
 
NMI_API 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_prng_get_random_bytes (uint8 *pu8PrngBuff, uint16 u16PrngSize)
 Get random bytes using the PRNG bytes. More...
 
NMI_API sint8 m2m_wifi_reinit (tstrWifiInitParam *pWifiInitParam)
 De-initialize and then initialize wifi. Resets the WINC. More...
 
NMI_API sint8 m2m_wifi_reinit_hold (void)
 First part of m2m_wifi_reinit, up to the point of initializing SPI for flash access. More...
 
NMI_API sint8 m2m_wifi_reinit_start (tstrWifiInitParam *pWifiInitParam)
 Second part of m2m_wifi_reinit, continuing from where m2m_wifi_reinit_hold left off. More...
 
NMI_API sint8 m2m_wifi_req_client_ctrl (uint8 cmd)
 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...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_request_dhcp_client (void)
 Legacy (deprecated) Asynchronous API for starting a DHCP client on the WINC. More...
 
NMI_API sint8 m2m_wifi_request_dhcp_server (uint8 *addr)
 Legacy (deprecated) asynchronous function to start a DHCP client on the WINC. More...
 
NMI_API sint8 m2m_wifi_request_scan (uint8 ch)
 Asynchronous API to request the WINC to scan for networks. More...
 
NMI_API sint8 m2m_wifi_request_scan_passive (uint8 ch, uint16 scan_time)
 Similar to m2m_wifi_request_scan but performs passive scanning instead of active scanning. More...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API 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...
 
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)
 Set the WINC3400 device name which is used as P2P device name. More...
 
sint8 m2m_wifi_set_gain_table_idx (uint8 u8GainTableIdx)
 set the gain table index corresponding to a specific WiFi region More...
 
sint8 m2m_wifi_set_gains (tstrM2mWifiGainsParams *pstrM2mGain)
 Set the chip PPA gain for 11b/11gn. More...
 
NMI_API 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...
 
NMI_API 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...
 
NMI_API sint8 m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption)
 Synchronous API for configuring the behaviour of the WINC 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 scanning behaviour. More...
 
NMI_API sint8 m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
 Set the power saving mode for the WINC3400. More...
 
NMI_API sint8 m2m_wifi_set_static_ip (tstrM2MIPConfig *pstrStaticIPConf)
 Asynchronous API to manually assign a (static) IP address to the WINC. More...
 
NMI_API 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...
 
NMI_API 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...
 
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_start_provision_mode_ext (tstrM2MAPModeConfig *pstrAPModeConfig, char *pcHttpServerDomainName, uint8 bEnableHttpRedirect)
 Asynchronous API for control of Wi-Fi provisioning functionality with extended options. More...
 
NMI_API sint8 m2m_wifi_stop_provision_mode (void)
 Synchronous API for terminating provisioning mode on the WINC. More...
 
NMI_API sint8 m2m_wifi_wps (uint8 u8TriggerType, const char *pcPinNumber)
 Asynchronous API to engage the WINC Wi-Fi Protected Setup (enrollee) function. More...
 
NMI_API sint8 m2m_wifi_wps_disable (void)
 Asynchronous API that disables Wi-Fi Protected Setup mode in the WINC. More...
 
NMI_API void m2m_wifi_yield (void)
 Yield from processing more synchronous M2M events. More...