mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-17 21:56:40 +01:00
Resolve "OTA"
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
#ifndef __MESHNET_H__
|
||||
#define __MESHNET_H__
|
||||
|
||||
#ifdef ESP32
|
||||
#include <WiFi.h>
|
||||
#elif defined(ESP8266)
|
||||
#include <ESP8266WiFi.h>
|
||||
#endif // ESP32
|
||||
|
||||
#include <painlessMesh.h>
|
||||
#include <WiFiClient.h>
|
||||
#include "Network.h"
|
||||
@@ -8,6 +14,7 @@
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
|
||||
// FIXME non-mesh config should have it's own struct
|
||||
struct MeshConfig {
|
||||
int stationMode;
|
||||
int channel;
|
||||
@@ -27,14 +34,18 @@ class MeshNet : public Network {
|
||||
|
||||
MeshNet(MeshConfig cfg);
|
||||
Network* init();
|
||||
|
||||
void update(); // only needed when no scheduler was passed to mesh.init
|
||||
Network* connectStation();
|
||||
|
||||
void update();
|
||||
void newConnectionCallback(uint32_t nodeId);
|
||||
void changedConnectionCallback();
|
||||
void nodeTimeAdjustedCallback(int32_t offset);
|
||||
void broadcast(String msg);
|
||||
void sendTo(uint32_t target, String msg);
|
||||
void onReceive(std::function<void(uint32_t from, String &msg)>);
|
||||
int isConnected(){
|
||||
return WiFi.status() == WL_CONNECTED;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user