mirror of
https://gitlab.com/wirelos/sprocket-network-wifi.git
synced 2025-12-16 05:24:31 +01:00
esp32 compatibility
This commit is contained in:
@@ -19,7 +19,11 @@ WiFiNet::WiFiNet(
|
||||
|
||||
int WiFiNet::connect(){
|
||||
config.fromFile("/config.json");
|
||||
WiFi.hostname(config.hostname);
|
||||
#ifdef ESP32
|
||||
WiFi.setHostname(config.hostname.c_str());
|
||||
#elif defined(ESP8266)
|
||||
WiFi.hostname(config.hostname.c_str());
|
||||
#endif
|
||||
Serial.println("Hostname: " + config.hostname);
|
||||
if(!connectStation()) {
|
||||
createAccessPoint();
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef __WIFI_NET__
|
||||
#define __WIFI_NET__
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
|
||||
|
||||
#ifdef ESP32
|
||||
#include <WiFi.h>
|
||||
#include <ESPmDNS.h>
|
||||
#elif defined(ESP8266)
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
#endif // ESP32
|
||||
|
||||
#include "Network.h"
|
||||
|
||||
Reference in New Issue
Block a user