[GH-ISSUE #428] [SOLVED?]: "using" problem with RSSI and SSID #359

Closed
opened 2026-02-28 01:24:56 +03:00 by kerem · 5 comments
Owner

Originally created by @giovannicandotti on GitHub (Sep 24, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/428

Hi,
I faced a problem when compiling under Debian with Eclipse.
In header ESP8266WiFi.h

class ESP8266WiFiClass : public ESP8266WiFiGenericClass, public ESP8266WiFiSTAClass, public ESP8266WiFiScanClass, public ESP8266WiFiAPClass {
public:
[...]
using ESP8266WiFiSTAClass::SSID;
using ESP8266WiFiSTAClass::RSSI;
[...]
using ESP8266WiFiScanClass::SSID;
using ESP8266WiFiScanClass::RSSI;
[...]

causes a compiling error on ESP8266WiFi.cpp
/* Wifi config page handler */
void WiFiManager::handleWifi(boolean scan) {
[...]
// old sort
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (WiFi.RSSI(indices[j]) > WiFi.RSSI(indices[i])) { // <-- error here
std::swap(indices[i], indices[j]);
}
}
}
[...]

and later on too, involving WiFi.SSID too.
Imo, it seems due to compiler not being able to properly address to ESP8266WiFiScanClass::RSSI.

Solution:

  1. in ESP8266WiFiScan.h add something like
    String mySSID(uint8_t networkItem);
    int32_t myRSSI(uint8_t networkItem);

  2. in ESP8266WiFiScan.ccp add something like
    int32_t ESP8266WiFiScanClass::myRSSI(uint8_t i) { return RSSI(i); }
    String ESP8266WiFiScanClass::mySSID(uint8_t i) { return SSID(i); }

  3. in ESP8266WiFi.h add something like
    using ESP8266WiFiScanClass::mySSID;
    using ESP8266WiFiScanClass::myRSSI;

  4. in ESP8266WiFi.cpp substitute
    WiFi.RSSI with WiFi.myRSSI
    WiFi.SSID with WiFi.mySSID

Sorry for poor coding style, quick & dirty solution and maybe violation of naming convention
Just an idea to solve.

[EDIT]
By the way, the original code generates compiling errors on Mac+Eclipse, while linking is able to complete, producing a working executable

Originally created by @giovannicandotti on GitHub (Sep 24, 2017). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/428 Hi, I faced a problem when compiling under Debian with Eclipse. In header **ESP8266WiFi.h** class ESP8266WiFiClass : public ESP8266WiFiGenericClass, public ESP8266WiFiSTAClass, public ESP8266WiFiScanClass, public ESP8266WiFiAPClass { public: [...] using ESP8266WiFiSTAClass::SSID; using ESP8266WiFiSTAClass::RSSI; [...] using ESP8266WiFiScanClass::SSID; using ESP8266WiFiScanClass::RSSI; [...] causes a compiling error on **ESP8266WiFi.cpp** /* Wifi config page handler */ void WiFiManager::handleWifi(boolean scan) { [...] // old sort for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (WiFi.RSSI(indices[j]) > WiFi.RSSI(indices[i])) { **// <-- error here** std::swap(indices[i], indices[j]); } } } [...] and later on too, involving WiFi.SSID too. Imo, it seems due to compiler not being able to properly address to ESP8266WiFiScanClass::RSSI. **Solution:** 1) in **ESP8266WiFiScan.h** add something like **String mySSID(uint8_t networkItem); int32_t myRSSI(uint8_t networkItem);** 2) in **ESP8266WiFiScan.ccp** add something like **int32_t ESP8266WiFiScanClass::myRSSI(uint8_t i) { return RSSI(i); }** **String ESP8266WiFiScanClass::mySSID(uint8_t i) { return SSID(i); }** 3) in **ESP8266WiFi.h** add something like **using ESP8266WiFiScanClass::mySSID; using ESP8266WiFiScanClass::myRSSI;** 4) in **ESP8266WiFi.cpp** substitute **WiFi.RSSI** with **WiFi.myRSSI** **WiFi.SSID** with **WiFi.mySSID** Sorry for poor coding style, quick & dirty solution and maybe violation of naming convention Just an idea to solve. **[EDIT]** By the way, the original code generates compiling errors on Mac+Eclipse, while linking is able to complete, producing a working executable
kerem closed this issue 2026-02-28 01:24:56 +03:00
Author
Owner

@tablatronix commented on GitHub (Sep 24, 2017):

do you have exact errors ?
I compile with platformio and stable esp core 1.5.3 and have no warnings.

Maybe a compiler flag is causing this ?

can you test the esp wifi scan example and see if this is a core bug? Not wifimanager?

<!-- gh-comment-id:331710529 --> @tablatronix commented on GitHub (Sep 24, 2017): do you have exact errors ? I compile with platformio and stable esp core 1.5.3 and have no warnings. Maybe a compiler flag is causing this ? can you test the esp wifi scan example and see if this is a core bug? Not wifimanager?
Author
Owner

@giovannicandotti commented on GitHub (Sep 24, 2017):

attached the screenshot

<...>
Invalid arguments' Candidates are: int RSSI()'
<...>

On 24 Sep 2017, at 15:36, Shawn A notifications@github.com wrote:

do you have exact errors ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tzapu/WiFiManager/issues/428#issuecomment-331710529, or mute the thread https://github.com/notifications/unsubscribe-auth/APzey5I_BE7cmKjoxqtsmP0AHgncOONtks5sllr2gaJpZM4Ph32r.

<!-- gh-comment-id:331711086 --> @giovannicandotti commented on GitHub (Sep 24, 2017): attached the screenshot <...> Invalid arguments' Candidates are: int RSSI()' <...> > On 24 Sep 2017, at 15:36, Shawn A <notifications@github.com> wrote: > > do you have exact errors ? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/tzapu/WiFiManager/issues/428#issuecomment-331710529>, or mute the thread <https://github.com/notifications/unsubscribe-auth/APzey5I_BE7cmKjoxqtsmP0AHgncOONtks5sllr2gaJpZM4Ph32r>. >
Author
Owner

@tablatronix commented on GitHub (Oct 29, 2017):

I see no screenshot

<!-- gh-comment-id:340311775 --> @tablatronix commented on GitHub (Oct 29, 2017): I see no screenshot
Author
Owner

@giovannicandotti commented on GitHub (Oct 30, 2017):

attached to this email

On 30 Oct 2017, at 00:25, Shawn A notifications@github.com wrote:

I see no screenshot


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tzapu/WiFiManager/issues/428#issuecomment-340311775, or mute the thread https://github.com/notifications/unsubscribe-auth/APzey4Vref_fb6UAQxrpJKMpwz_RSWWOks5sxQlfgaJpZM4Ph32r.

<!-- gh-comment-id:340347481 --> @giovannicandotti commented on GitHub (Oct 30, 2017): attached to this email > On 30 Oct 2017, at 00:25, Shawn A <notifications@github.com> wrote: > > I see no screenshot > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/tzapu/WiFiManager/issues/428#issuecomment-340311775>, or mute the thread <https://github.com/notifications/unsubscribe-auth/APzey4Vref_fb6UAQxrpJKMpwz_RSWWOks5sxQlfgaJpZM4Ph32r>. >
Author
Owner

@tablatronix commented on GitHub (Oct 30, 2017):

You have to goto github to post images

<!-- gh-comment-id:340414828 --> @tablatronix commented on GitHub (Oct 30, 2017): You have to goto github to post images
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#359
No description provided.