Skip to content
Snippets Groups Projects

DEPFET Q2M1 Power Procedure

Merged Cyril Danilevski requested to merge q2m1_test into main
1 file
+ 6
8
Compare changes
  • Side-by-side
  • Inline
+ 6
8
@@ -148,7 +148,7 @@ void sendSNMP() {
@@ -148,7 +148,7 @@ void sendSNMP() {
}
}
}
}
auto ipAddr = IPAddress(192, 168, 140, 79);
auto ipAddr = pproc.ipAddr;
if (output != NONE && channel != 0) {
if (output != NONE && channel != 0) {
setChannelAndWait(&ipAddr, channel, output);
setChannelAndWait(&ipAddr, channel, output);
@@ -243,13 +243,12 @@ void powerAllOff() {
@@ -243,13 +243,12 @@ void powerAllOff() {
}
}
String http_msg = "{\n";
String http_msg = "{\n";
http_msg += "\"arguments\":{";
http_msg += "\"groups\":\"" + groups + "\",";
http_msg += "\"groups\":\"" + groups + "\",";
http_msg += "\"success\":" + String(success);
http_msg += "\"success\":" + String(success);
if (success) {
// if (success) {
http_msg += ",\n\"status\":\n";
// http_msg += ",\n\"status\":\n";
http_msg += pproc.toJSON();
// http_msg += pproc.toJSON();
}
// }
http_msg += "\n}";
http_msg += "\n}";
restServer.send(success ? 200 : 406, "text/json", http_msg);
restServer.send(success ? 200 : 406, "text/json", http_msg);
@@ -267,9 +266,8 @@ void pollMPODChannel() {
@@ -267,9 +266,8 @@ void pollMPODChannel() {
if (!channel) {
if (!channel) {
ret = "\"reason\": \"Invalid channel\"";
ret = "\"reason\": \"Invalid channel\"";
} else {
} else {
auto ipAddr = IPAddress(192, 168, 140, 79);
SNMP::Message *snmp_msg = mpod.read(channel);
SNMP::Message *snmp_msg = mpod.read(channel);
snmp.send(snmp_msg, ipAddr, SNMP::Port::SNMP);
snmp.send(snmp_msg, pproc.ipAddr, SNMP::Port::SNMP);
delete snmp_msg;
delete snmp_msg;
delay(MPOD_UPDATE_LATENCY);
delay(MPOD_UPDATE_LATENCY);
Loading