1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Merge pull request #847 from pgollor/esp8266

use String return for both SSID functions
This commit is contained in:
Ivan Grokhotkov 2015-10-02 14:37:38 +03:00
commit b27a4d142f
3 changed files with 5 additions and 5 deletions

View File

@ -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>");

View File

@ -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)

View File

@ -239,7 +239,7 @@ public:
*
* 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