mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 23:22:19 +03:00
recovery
This commit is contained in:
35
src/Class/ScenarioClass3.cpp
Normal file
35
src/Class/ScenarioClass3.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "Class/ScenarioClass3.h"
|
||||
|
||||
#include "MqttClient.h"
|
||||
#include "RemoteOrdersUdp.h"
|
||||
Scenario* myScenario;
|
||||
|
||||
void eventGen2(String eventName, String eventValue) {
|
||||
if (!jsonReadBool(configSetupJson, "scen")) {
|
||||
return;
|
||||
}
|
||||
String event = eventName + " " + eventValue + ",";
|
||||
eventBuf += event;
|
||||
|
||||
SerialPrint("I", "Event add", eventName + " " + eventValue);
|
||||
|
||||
if (jsonReadBool(configSetupJson, "MqttOut")) {
|
||||
if (eventName != "timenow") {
|
||||
publishEvent(eventName, eventValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void streamEventUDP(String event) {
|
||||
#ifdef UDP_ENABLED
|
||||
|
||||
if (!jsonReadBool(configSetupJson, "snaUdp")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.indexOf("timenow") == -1) {
|
||||
event = "iotm;event:" + event;
|
||||
asyncUdp.broadcastTo(event.c_str(), 4210);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user