Skip to content

Commit 88c7719

Browse files
committed
Add support for String args to softAP and begin
1 parent 34e90f3 commit 88c7719

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch
185185
return ret;
186186
}
187187

188+
bool ESP8266WiFiAPClass::softAP(const String& ssid, const String& passphrase, int channel, int ssid_hidden, int max_connection) {
189+
return softAP(ssid.c_str(), passphrase.c_str(), channel, ssid_hidden, max_connection);
190+
}
188191

189192
/**
190193
* Configure access point

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiAP.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ESP8266WiFiAPClass {
3737
public:
3838

3939
bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4);
40+
bool softAP(const String& ssid,const String& passphrase = emptyString,int channel = 1,int ssid_hidden = 0,int max_connection = 4);
4041
bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet);
4142
bool softAPdisconnect(bool wifioff = false);
4243

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ wl_status_t ESP8266WiFiSTAClass::begin(char* ssid, char *passphrase, int32_t cha
190190
return begin((const char*) ssid, (const char*) passphrase, channel, bssid, connect);
191191
}
192192

193+
wl_status_t ESP8266WiFiSTAClass::begin(const String& ssid, const String& passphrase, int32_t channel, const uint8_t* bssid, bool connect) {
194+
return begin(ssid.c_str(), passphrase.c_str(), channel, bssid, connect);
195+
}
196+
193197
/**
194198
* Use to connect to SDK config.
195199
* @return wl_status_t

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class ESP8266WiFiSTAClass {
3838

3939
wl_status_t begin(const char* ssid, const char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
4040
wl_status_t begin(char* ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
41+
wl_status_t begin(const String& ssid, const String& passphrase = emptyString, int32_t channel = 0, const uint8_t* bssid = NULL, bool connect = true);
4142
wl_status_t begin();
4243

4344
//The argument order for ESP is not the same as for Arduino. However, there is compatibility code under the hood

0 commit comments

Comments
 (0)