-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Adding softAP SSID & PSK query API #4138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
e5c6259
3b79cb4
04d96d9
6501ba4
9f3e1bd
1d74009
0f6979f
3ecd00f
bff42fd
0339f5e
dcf64e1
a62c5ab
60b4a1d
3a80358
641d6c5
a2fe942
0309ded
6ca28ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,3 +333,23 @@ String ESP8266WiFiAPClass::softAPmacAddress(void) { | |
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); | ||
return String(macStr); | ||
} | ||
|
||
/** | ||
* Get the configured(Not-In-Flash) softAP SSID name. | ||
* @return String SSID. | ||
*/ | ||
String ESP8266WiFiAPClass::softAPSSID() const { | ||
struct softap_config config; | ||
wifi_softap_get_config(&config); | ||
return String(reinterpret_cast<char*>(config.ssid)); | ||
} | ||
|
||
/** | ||
* Get the configurd(Not-In-Flash) softAP PSK or PASSWORD. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor typo -> configured. |
||
* @return String psk. | ||
*/ | ||
String ESP8266WiFiAPClass::softAPPSK() const { | ||
struct softap_config config; | ||
wifi_softap_get_config(&config); | ||
return String(reinterpret_cast<char*>(config.password)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On second thought, this could cause an issue. When a 64-byte psk is used, it is not 0-terminated, and String assumes a null-terminator. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @devyte
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,9 @@ class ESP8266WiFiAPClass { | |
uint8_t* softAPmacAddress(uint8_t* mac); | ||
String softAPmacAddress(void); | ||
|
||
String softAPSSID() const; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation on this line is different from nearby lines |
||
String softAPPSK() const; | ||
|
||
protected: | ||
|
||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation in this function is different from nearby functions