Microchip® Advanced Software Framework

winc1500/host_app/provisioning/wifi_prov.h File Reference

WiFi Provisioning configuration.

Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.

#include "driver/include/m2m_wifi.h"
#include "driver/include/m2m_types.h"

Data Structures

struct  tstr1xAuthTLSCredentials
 
struct  wifiProvisionParams
 

Macros

#define CERT_BUFFER_SIZE   1200
 
#define HTTP_PORT   443
 HTTP server defines. More...
 
#define KEY_BUFFER_SIZE   1700
 
#define POST_RESP   "HTTP/1.1 201"
 
#define PRIVATE_KEY_MOD_EXP_SIZE   256
 
#define PROV_WEB_PAGE_WEP_KEY_INDEX   (1)
 
#define PROV_WLAN_AUTH   M2M_WIFI_SEC_OPEN /* < Security manner */
 
#define PROV_WLAN_CHANNEL   (1) /* < Channel number */
 
#define PROV_WLAN_SOFTAP_SSID   "WINC1500_PROV_HTTP" /* < SSID */
 Wi-Fi Settings. More...
 
#define PROV_WLAN_SSID_MODE   SSID_MODE_VISIBLE
 
#define RX_BUF_SZ   SOCKET_BUFFER_MAX_LENGTH
 

Enumerations

enum  enteprise_sec_method {
  TLS = 1,
  MSCHAPV2
}
 

Functions

void wifi_ap_connect (wifiProvisionParams *provParams)
 Wi-Fi Provisioning ap connect function. More...
 
void wifi_ap_provision (wifiProvisionParams *provParams)
 Wi-Fi Provisioning main application function. More...
 

Variables

tstr1xAuthTLSCredentials tlsCredentials
 

#define CERT_BUFFER_SIZE   1200
#define HTTP_PORT   443

HTTP server defines.

#define KEY_BUFFER_SIZE   1700
#define POST_RESP   "HTTP/1.1 201"
#define PRIVATE_KEY_MOD_EXP_SIZE   256
#define PROV_WEB_PAGE_WEP_KEY_INDEX   (1)
#define PROV_WLAN_AUTH   M2M_WIFI_SEC_OPEN /* < Security manner */
#define PROV_WLAN_CHANNEL   (1) /* < Channel number */
#define PROV_WLAN_SOFTAP_SSID   "WINC1500_PROV_HTTP" /* < SSID */

Wi-Fi Settings.

#define PROV_WLAN_SSID_MODE   SSID_MODE_VISIBLE
#define RX_BUF_SZ   SOCKET_BUFFER_MAX_LENGTH

Enumerator
TLS 
MSCHAPV2 

void wifi_ap_connect ( wifiProvisionParams provParams)

Wi-Fi Provisioning ap connect function.

This is a will connect to the AP with the credentials received in wifiProvisionParams The user is expected to perfom m2m_wifi_init() before calling this api.

This will connect to the AP with the credentials received in wifiProvisionParams The user is expected to perform m2m_wifi_init() before calling this api.

References tstr1xAuthCredentials::au8Passwd, tstrM2MProvisionInfo::au8Password, tstrM2MProvisionInfo::au8SSID, tstr1xAuthCredentials::au8UserName, tstrM2mWifiWepParams::au8WepKey, tstrAuth1xMschap2::bPrependDomain, tstrAuth1xTls::bPrependDomain, tstrAuth1xMschap2::bUnencryptedUserName, tstrAuth1xTls::bUnencryptedUserName, tstrNetworkId::enuChannel, wifiProvisionParams::httpMsChapv2Params, wifiProvisionParams::httpProvParams, wifiProvisionParams::httpTLSParams, wifiProvisionParams::httpWepParams, m2m_strlen(), M2M_WIFI_CH_ALL, m2m_wifi_connect(), m2m_wifi_connect_1x_mschap2(), m2m_wifi_connect_1x_tls(), M2M_WIFI_SEC_802_1X, M2M_WIFI_SEC_OPEN, M2M_WIFI_SEC_WEP, M2M_WIFI_SEC_WPA_PSK, MSCHAPV2, NULL, printf, PROV_WEB_PAGE_WEP_KEY_INDEX, tstrNetworkId::pu8Bssid, tstrAuth1xTls::pu8Certificate, tstrAuth1xMschap2::pu8Domain, tstrAuth1xTls::pu8Domain, tstrAuth1xMschap2::pu8Password, tstrAuth1xTls::pu8PrivateKey_Exp, tstrAuth1xTls::pu8PrivateKey_Mod, tstrNetworkId::pu8Ssid, tstrAuth1xMschap2::pu8UserName, tstrAuth1xTls::pu8UserName, wifiProvisionParams::sec_method, TLS, tstrAuth1xTls::u16CertificateLen, tstrAuth1xMschap2::u16PasswordLen, tstrAuth1xTls::u16PrivateKeyLen, tstrAuth1xMschap2::u16UserNameLen, tstrAuth1xTls::u16UserNameLen, tstrM2mWifiWepParams::u8KeyIndx, tstrM2mWifiWepParams::u8KeySz, tstrM2MProvisionInfo::u8SecType, tstrNetworkId::u8SsidLen, and WIFI_CRED_SAVE_ENCRYPTED.

Referenced by main().

void wifi_ap_provision ( wifiProvisionParams provParams)

Wi-Fi Provisioning main application function.

This is a bocking function that wait for the user to connect to the PROV_WLAN_SOFTAP_SSID and provide the credentials in web page https://192.168.1.1/provisioning.html. The user is expected to close all the open socket and perofrm socketDeinit() and m2m_wifi_deinit before this function is called

This is a blocking function that wait for the user to connect to the PROV_WLAN_SOFTAP_SSID and provide the credentials in web page http://192.168.1.1/provisioning.html. The user is expected to close all the open socket and perform socketDeinit() and m2m_wifi_deinit before this function is called

References _htons, AF_INET, APP_PROV_AP_DISABLE, APP_PROV_DEINIT, APP_PROV_END, APP_PROV_IDLE, APP_PROV_START, APP_PROV_WINC_CONNECTED, tstrM2MAPConfig::au8DHCPServerIP, tstrM2MAPConfig::au8SSID, tstrM2MAPConfig::au8WepKey, bind(), close(), gu8AppStatus, HTTP_PORT, http_server_socket, M2M_SUCCESS, m2m_wifi_deinit(), m2m_wifi_disable_ap(), m2m_wifi_enable_ap(), m2m_wifi_handle_events(), m2m_wifi_init(), NULL, printf, prov_socket_cb(), prov_wifi_cb(), PROV_WLAN_AUTH, PROV_WLAN_CHANNEL, PROV_WLAN_SOFTAP_SSID, PROV_WLAN_WEP_KEY, PROV_WLAN_WEP_KEY_INDEX, registerSocketCallback(), ret, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_port, SOCK_STREAM, socket(), SOCKET_FLAGS_SSL, socketDeinit(), socketInit(), tcp_client_socket, tstrM2MAPConfig::u8KeyIndx, tstrM2MAPConfig::u8KeySz, tstrM2MAPConfig::u8ListenChannel, and tstrM2MAPConfig::u8SecType.

Referenced by main().

tstr1xAuthTLSCredentials tlsCredentials

Referenced by post_main_page().