mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #381] Error calling configModeCallback inside another class #320
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#320
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 @jcmojj on GitHub (Jul 1, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/381
I made the class Internet to take out of the main code all the code from wifiManager and make it cleaner, but I have a problem with the configModeCallback that have an error that I don't know how to fix.
The internet class is:
I call from setup: with
internet.wifiAutoConnect(resetWifi);I call from loop with
internet.wifiCheckToConnectOnDemand(resetWifi);I get this error message:
I know that the code expected that the configModeCallback was inside of the main code and not inside another class. If someone can give me a tip to change something in my code or inside the lib, you are welcome. To make it easy the part of the lib that deals with this function is:
@tablatronix commented on GitHub (Aug 28, 2017):
You probably need to put wifimanager globally across your class, you are calling it in each function.
@suculent commented on GitHub (Sep 6, 2017):
I have similar issue.
And the error. It probably needs just some casting. One issue is that when dropping WiFiManager into a C++ class, you need to change dot notation from examples to "->" and even more:
@suculent commented on GitHub (Oct 30, 2017):
Thanks to this example: https://github.com/ajfisher/espixel/blob/master/firmware/esp8266_pixel/configurator.cpp
Solved by turning callback (and everything accessed from the callback) to static property. This resolved the
<unresolved overloaded function type>error.And no, I don't have WiFiManager global in order to deallocate it immediately after it gets used->useless.
See:
github.com/suculent/thinx-lib-esp8266-arduinoc@a2a2a6bfda/src/THiNXLib.cppgithub.com/suculent/thinx-lib-esp8266-arduinoc@a2a2a6bfda/src/THiNXLib.h@tablatronix commented on GitHub (Oct 30, 2017):
oh ok, maybe post example code for others with the same issue.
@keitetran commented on GitHub (Jul 4, 2018):
add static to var and function
Look https://github.com/ajfisher/espixel/blob/master/firmware/esp8266_pixel/configurator.h#L52