mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #428] [SOLVED?]: "using" problem with RSSI and SSID #359
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#359
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
in ESP8266WiFiScan.h add something like
String mySSID(uint8_t networkItem);
int32_t myRSSI(uint8_t networkItem);
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); }
in ESP8266WiFi.h add something like
using ESP8266WiFiScanClass::mySSID;
using ESP8266WiFiScanClass::myRSSI;
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
@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?
@giovannicandotti commented on GitHub (Sep 24, 2017):
attached the screenshot
<...>
Invalid arguments' Candidates are: int RSSI()'
<...>
@tablatronix commented on GitHub (Oct 29, 2017):
I see no screenshot
@giovannicandotti commented on GitHub (Oct 30, 2017):
attached to this email
@tablatronix commented on GitHub (Oct 30, 2017):
You have to goto github to post images