Update to current Sming master
parent
01a2857990
commit
281c071ba5
|
@ -33,7 +33,7 @@ public:
|
|||
return 400;
|
||||
}
|
||||
|
||||
void onConnected();
|
||||
virtual void onConnected();
|
||||
};
|
||||
|
||||
template <class T> class ValueEndpoint : public Endpoint {
|
||||
|
|
|
@ -18,14 +18,10 @@
|
|||
|
||||
class SpejsNode {
|
||||
protected:
|
||||
MqttClient mqtt;
|
||||
HttpServer http;
|
||||
|
||||
Timer keepaliveTimer;
|
||||
|
||||
HashMap<String, Endpoint*> endpoints;
|
||||
|
||||
void onConnected();
|
||||
void keepAliveHandler();
|
||||
void initializeMDNS();
|
||||
|
||||
|
@ -37,6 +33,9 @@ protected:
|
|||
void httpIndex(HttpRequest &request, HttpResponse &response);
|
||||
void httpMetadata(HttpRequest &request, HttpResponse &response);
|
||||
public:
|
||||
MqttClient mqtt;
|
||||
HttpServer http;
|
||||
|
||||
String deviceID;
|
||||
String deviceType;
|
||||
|
||||
|
@ -46,6 +45,8 @@ public:
|
|||
mqtt(MQTT_BROKER, MQTT_PORT, MqttStringSubscriptionCallback(&SpejsNode::mqttCallback, this)),
|
||||
deviceType(_deviceType) {};
|
||||
|
||||
void onConnected();
|
||||
|
||||
void init();
|
||||
|
||||
bool notify(String key, String value);
|
||||
|
|
|
@ -20,10 +20,3 @@ void DHTEndpoint::sample() {
|
|||
Serial.print(sensor.getLastError());
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_ENDPOINT(
|
||||
kolejnypapiez,
|
||||
*[]() {
|
||||
return (Endpoint*) new DHTEndpoint(5);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -41,7 +41,7 @@ void ImplementationEndpoint::startOTA() {
|
|||
}
|
||||
#endif
|
||||
|
||||
otaUpdater->setCallback(otaUpdateDelegate(&ImplementationEndpoint::otaUpdateCallback, this));
|
||||
otaUpdater->setCallback(OtaUpdateDelegate(&ImplementationEndpoint::otaUpdateCallback, this));
|
||||
otaUpdater->start();
|
||||
|
||||
notify("ota", "started");
|
||||
|
|
|
@ -13,10 +13,3 @@ EndpointResult OutputEndpoint::onValue(String property, String value) {
|
|||
notify("on", currentValue ? "true" : "false");
|
||||
return 200;
|
||||
}
|
||||
|
||||
DECLARE_ENDPOINT(
|
||||
papiezpedofilxD,
|
||||
*[]() {
|
||||
return (Endpoint*) new OutputEndpoint(5);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
MODULES = app ../spejsiot
|
||||
MODULES = app ../spejsiot ../spejsiot/endpoints
|
||||
DISABLE_SPIFFS = 1
|
||||
USER_CFLAGS = -I../common
|
||||
#ENABLE_SSL = 1
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <SpejsNode.h>
|
||||
#include <endpoints/OutputEndpoint.h>
|
||||
|
||||
SpejsNode node("switch");
|
||||
|
||||
|
|
Loading…
Reference in New Issue