WINC3400 IoT Application Interface.
Copyright (c) 2017-2021 Microchip Technology Inc. and its subsidiaries.
#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) |
Ethernet (Bypass mode) notification callback function receiving Bypass mode events as defined in the Wi-Fi responses enumeration tenuM2mStaCmd. More... | |
typedef void(* | tpfAppWifiCb )(uint8 u8MsgType, void *pvMsg) |
This is the main callback function for the Wi-Fi driver and is responsible for processing any M2M_WIFI events that are received on the Wi-Fi interface. These events (notifications) are usually received in response to earlier Wi-Fi requests such as m2m_wifi_request_scan, m2m_wifi_connect_open, m2m_wifi_get_connection_info m2m_wifi_req_curr_rssi, m2m_wifi_get_system_time, etc. More... | |
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 | tenuTlsCertExpSettings { TLS_CERT_EXP_CHECK_DISABLE, TLS_CERT_EXP_CHECK_ENABLE, TLS_CERT_EXP_CHECK_EN_IF_SYS_TIME } |
TLS Certificate Expiry Validation Options. More... | |
enum | tenuWifiState { WIFI_STATE_DEINIT, WIFI_STATE_INIT, WIFI_STATE_START, WIFI_STATE_DEINIT, WIFI_STATE_INIT, WIFI_STATE_START } |
Enumeration for Wi-Fi state The following is used to track the state of the wifi (not initialized, initialized or started) More... | |
Functions | |
NMI_API sint8 | m2m_ota_get_firmware_version (tstrM2mRev *pstrRev) |
Synchronous API to obtain the firmware version of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC. More... | |
sint8 | m2m_wifi_1x_get_option (tenu1xOption enuOptionName, void *pOptionValue, size_t *pOptionLen) |
API to get (read) options relating to Wi-Fi connection using WPA(2) Enterprise authentication. 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_ble_api_send (uint8 *msg, uint32 len) |
Asynchronous API to send an encapsulated Atmel BLE message over the Wifi Host Interface. More... | |
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... | |
sint8 | m2m_wifi_check_ota_rb (void) |
Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC. 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 u8SaveCred) |
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... | |
NMI_API 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... | |
NMI_API 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... | |
uint32 | m2m_wifi_get_chipId (void) |
Get the WINC Chip ID. More... | |
NMI_API 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... | |
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_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_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 known that BLE functionality will not be used for any significant length of time. 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_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. 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) |
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... | |
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... | |
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... | |
NMI_API 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... | |
NMI_API 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... | |