tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.55k stars 1.97k forks source link

The definition of the "init ()" method is missing #830

Closed ferchinas closed 5 years ago

ferchinas commented 5 years ago

Hello: I am updating the version of WifiManager to use it with ESP32, and I find the following problems.

Hardware

WiFimanager Branch/Release:

Esp8266/Esp32:

Hardware: ESP-12e, esp01, esp25

ESP32 Core Version:

Description

There is a declaration of init () that does not have its definition. The init () method, is defined as "protected", and I can not use it to initialize the object. (I do not initialize it in the constructor because the "wm" object I use it as a member of my own class)

I already solve these problems by modifying the library, and so I can compile my application. It would be nice if the library includes the changes

Thank you

tablatronix commented 5 years ago

init is a method of wifimanager parameter class...

what changes did you make and what are you doing ?

ferchinas commented 5 years ago

I was using the library a year ago, now I wanted to update it and my code did not compile. That's why I found that:

The method in WifiManager.h line 128, is not defined in WifiManager.cpp void init (const char * id, const char * label, const char * defaultValue, int length, const char * custom);

And this method in the current version of the library is protected.

My modification was: 1) Add the definition:

void WiFiManagerParameter :: init (const char * id, const char * label, const char * defaultValue, int length, const char * custom) {
init (id, label, defaultValue, length, custom, WFM_LABEL_BEFORE);
}

2) I made public the init () methods

//protected:            
    void init(const char *id, const char *label, const char *defaultValue, int length, const char *custom);
    void init(const char *id, const char *label, const char *defaultValue, int length, const char *custom, int labelPlacement);
tablatronix commented 5 years ago

Oh I see there are 2 init, odd