mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
remove init in wifi net, load config in connect method
This commit is contained in:
@@ -17,11 +17,8 @@ WiFiNet::WiFiNet(
|
|||||||
config.connectTimeout = connectTimeout;
|
config.connectTimeout = connectTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
Network* WiFiNet::init() {
|
|
||||||
config.fromFile("/config.json");
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
int WiFiNet::connect(){
|
int WiFiNet::connect(){
|
||||||
|
config.fromFile("/config.json");
|
||||||
WiFi.hostname(config.hostname);
|
WiFi.hostname(config.hostname);
|
||||||
Serial.println("Hostname: " + config.hostname);
|
Serial.println("Hostname: " + config.hostname);
|
||||||
if(!connectStation()) {
|
if(!connectStation()) {
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ class WiFiNet : public Network {
|
|||||||
public:
|
public:
|
||||||
WiFiConfig config;
|
WiFiConfig config;
|
||||||
WiFiNet(int stationMode, const char* stationSSID, const char* stationPassword, const char* apSSID, const char* apPassword, const char* hostname, int connectTimeout);
|
WiFiNet(int stationMode, const char* stationSSID, const char* stationPassword, const char* apSSID, const char* apPassword, const char* hostname, int connectTimeout);
|
||||||
Network* init();
|
|
||||||
int connect();
|
int connect();
|
||||||
int connectStation();
|
int connectStation();
|
||||||
int createAccessPoint();
|
int createAccessPoint();
|
||||||
|
|||||||
Reference in New Issue
Block a user