mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
first
This commit is contained in:
33
src/Class/ScenarioClass3.cpp
Normal file
33
src/Class/ScenarioClass3.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#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;
|
||||
|
||||
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