@@ -41,33 +41,17 @@ typedef enum _eap_methods {
4141 EAP_TTLS = 2 ,
4242} eap_method;
4343
44- class WPA2Enterprise
44+ class WPA2EnterpriseClass
4545{
4646public:
47- WPA2Enterprise (eap_method method, String identity, String username = " " , String password = " " ,
48- const char * ca_pem = NULL , const char * client_crt = NULL , const char * client_key = NULL ) :
49- method (method), identity(identity), username(username), password(password),
50- ca_pem (ca_pem), client_crt(client_crt), client_key(client_key)
51- {}
52- WPA2Enterprise (String identity, String username = " " , String password = " " ,
53- const char * ca_pem = NULL , const char * client_crt = NULL , const char * client_key = NULL ) :
54- method (EAP_TLS), identity(identity), username(username), password(password),
55- ca_pem (ca_pem), client_crt(client_crt), client_key(client_key)
56- {}
57- WPA2Enterprise (String identity, const char * ca_pem = NULL , const char * client_crt = NULL , const char * client_key = NULL ) :
58- method (EAP_TLS), identity(identity), username(" " ), password(" " ),
59- ca_pem (ca_pem), client_crt(client_crt), client_key(client_key)
60- {}
61-
62- eap_method method; // TLS: 0, PEAP: 1, TTLS: 2 // looks like it's handled internally
63- String identity;
64- String username;
65- String password;
66- const char * ca_pem;
67- const char * client_crt;
68- const char * client_key;
47+ void clear ();
48+ void save ();
49+ void addCACertificate (const char * ca_pem);
50+ void addClientCertificate (const char * client_crt, const char * client_key);
6951};
7052
53+ extern WPA2EnterpriseClass WPA2Enterprise;
54+
7155class WiFiClass
7256{
7357private:
@@ -113,11 +97,13 @@ class WiFiClass
11397 uint8_t beginAP (const char *ssid, const char * passphrase);
11498 uint8_t beginAP (const char *ssid, const char * passphrase, uint8_t channel);
11599
116- /* Add WPA2 Enterprise information for next connection
100+ /* Start Wifi connection with wpa2 enterprise
117101 *
118- * param data: Static ip configuration
102+ * helper function for most university WPA2 connections
103+ * if a fine-grained configuration is needed (like adding certificates)
104+ * use WPA2Enterprise functions and then call begin() normally
119105 */
120- void config (WPA2Enterprise& data );
106+ int beginEnterprise ( const char *ssid, const char * username, const char * password );
121107
122108 /* Change Ip configuration settings disabling the dhcp client
123109 *
0 commit comments