Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit628b668

Browse files
dok-netme-no-dev
andauthored
Add overloads to support __FlashStringHelper like ESP8266 has them. (espressif#8111)
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
1 parent9d8471d commit628b668

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

‎cores/esp32/WString.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// A pure abstract class forward used as a means to proide a unique pointer type
3535
// but really is never defined.
3636
class__FlashStringHelper;
37-
#defineFPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
37+
#defineFPSTR(str_pointer) (reinterpret_cast<const __FlashStringHelper *>(str_pointer))
3838
#defineF(string_literal) (FPSTR(PSTR(string_literal)))
3939

4040
// An inherited class for holding the result of a concatenation. These

‎libraries/ESPmDNS/src/ESPmDNS.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ MDNSResponder::~MDNSResponder() {
6060
end();
6161
}
6262

63-
boolMDNSResponder::begin(constchar* hostName){
63+
boolMDNSResponder::begin(constString& hostName){
6464
if(mdns_init()){
6565
log_e("Failed starting MDNS");
6666
returnfalse;
6767
}
6868
//WiFi.onEvent(_on_sys_event);
6969
_hostname = hostName;
7070
_hostname.toLowerCase();
71-
if(mdns_hostname_set(hostName)) {
71+
if(mdns_hostname_set(hostName.c_str())) {
7272
log_e("Failed setting MDNS hostname");
7373
returnfalse;
7474
}

‎libraries/ESPmDNS/src/ESPmDNS.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ class MDNSResponder {
5454
public:
5555
MDNSResponder();
5656
~MDNSResponder();
57-
boolbegin(constchar* hostName);
57+
boolbegin(const String& hostName);
58+
boolbegin(constchar* hostName){
59+
returnbegin(String(hostName));
60+
}
5861
voidend();
5962

6063
voidsetInstanceName(String name);

‎libraries/WiFi/src/WiFiSTA.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ class WiFiSTAClass
4545
public:
4646

4747
wl_status_tbegin(constchar* wpa2_ssid,wpa2_auth_method_t method,constchar* wpa2_identity=NULL,constchar* wpa2_username=NULL,constchar *wpa2_password=NULL,constchar* ca_pem=NULL,constchar* client_crt=NULL,constchar* client_key=NULL,int32_t channel=0,constuint8_t* bssid=0,bool connect=true);
48+
wl_status_tbegin(const String& wpa2_ssid,wpa2_auth_method_t method,const String& wpa2_identity = (constchar*)NULL,const String& wpa2_username = (constchar*)NULL,const String& wpa2_password = (constchar*)NULL,const String& ca_pem = (constchar*)NULL,const String& client_crt = (constchar*)NULL,const String& client_key = (constchar*)NULL, int32_t channel=0,const uint8_t* bssid=0, bool connect=true) {
49+
returnbegin(wpa2_ssid.c_str(), method, wpa2_identity.c_str(), wpa2_username.c_str(), wpa2_password.c_str(), ca_pem.c_str(), client_crt.c_str(), client_key.c_str(), channel, bssid, connect);
50+
}
4851
wl_status_tbegin(constchar* ssid,constchar *passphrase =NULL,int32_t channel =0,constuint8_t* bssid =NULL,bool connect =true);
52+
wl_status_tbegin(const String& ssid,const String& passphrase = (constchar*)NULL, int32_t channel = 0,const uint8_t* bssid = NULL, bool connect = true) {
53+
returnbegin(ssid.c_str(), passphrase.c_str(), channel, bssid, connect);
54+
}
4955
wl_status_tbegin(char* ssid,char *passphrase =NULL,int32_t channel =0,constuint8_t* bssid =NULL,bool connect =true);
5056
wl_status_tbegin();
5157

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp