Skip to content

use String return for both SSID functions #847

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

Merged
merged 2 commits into from
Oct 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void handleWifi() {
Serial.println("scan done");
if (n > 0) {
for (int i = 0; i < n; i++) {
server.sendContent(String() + "\r\n<tr><td>SSID " + String(WiFi.SSID(i)) + String((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":" *") + " (" + WiFi.RSSI(i) + ")</td></tr>");
server.sendContent(String() + "\r\n<tr><td>SSID " + WiFi.SSID(i) + String((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":" *") + " (" + WiFi.RSSI(i) + ")</td></tr>");
}
} else {
server.sendContent(String() + "<tr><td>No WLAN found</td></tr>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,13 +536,13 @@ void * ESP8266WiFiClass::_getScanInfoByIndex(int i)
return reinterpret_cast<bss_info*>(ESP8266WiFiClass::_scanResult) + i;
}

const char* ESP8266WiFiClass::SSID(uint8_t i)
String ESP8266WiFiClass::SSID(uint8_t i)
{
struct bss_info* it = reinterpret_cast<struct bss_info*>(_getScanInfoByIndex(i));
if (!it)
return 0;
return "";

return reinterpret_cast<const char*>(it->ssid);
return String(reinterpret_cast<const char*>(it->ssid));
}

uint8_t * ESP8266WiFiClass::BSSID(uint8_t i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class ESP8266WiFiClass
*
* return: ssid string of the specified item on the networks scanned list
*/
const char* SSID(uint8_t networkItem);
String SSID(uint8_t networkItem);

/*
* Return the encryption type of the networks discovered during the scanNetworks
Expand Down