Skip to content
Snippets Groups Projects
Commit 358b9d19 authored by Cyril Danilevski's avatar Cyril Danilevski
Browse files

Merge branch 'main' into test/simple_power_procedure

parents 5ea8bbf4 e157ce7a
No related branches found
No related tags found
1 merge request!7Draft: Do not merge: simple power procedure for test MPOD
Pipeline #167879 passed
......@@ -158,6 +158,8 @@ void powerOffCheckLoop() {
Serial.println(groups);
PINS.stage = "Ramped down";
// Poll the pins once to get latest status, as interrupts were disabled
poll_port_expander();
// This event has been handled.
PERFORM_PROCEDURE_FROM_INTERRUPT = 0;
// Inform SIB that we're done and it can take data again.
......
......@@ -91,7 +91,7 @@ void identify() {
message += "\n}";
restServer.send(418, "text/json", message);
restServer.send(418, "application/json", message);
}
void panel() {
......@@ -117,7 +117,7 @@ void notFound() {
}
message += "\n}\n}";
restServer.send(404, "text/json", message);
restServer.send(404, "application/json", message);
Serial.println(message);
}
......@@ -134,7 +134,8 @@ enum {
void sendSNMP() {
if (PINS.ramping) {
restServer.send(403, "text/json", "{\"success\": 0, \"reason\": \"ramping ongoing\"}");
restServer.send(403, "application/json",
"{\"success\": 0, \"reason\": \"ramping ongoing\"}");
return;
}
uint8_t output = NONE;
......@@ -180,21 +181,23 @@ void sendSNMP() {
http_msg += "\n}";
restServer.send(success ? 200 : 406, "text/json", http_msg);
restServer.send(success ? 200 : 406, "application/json", http_msg);
}
void getMpodStatus() {
if (PINS.ramping) {
restServer.send(403, "text/json", "{\"success\": 0, \"reason\": \"ramping ongoing\"}");
restServer.send(403, "application/json",
"{\"success\": 0, \"reason\": \"ramping ongoing\"}");
return;
}
restServer.send(200, "text/json", pproc.toJSON());
restServer.send(200, "application/json", pproc.toJSON());
}
void powerGroup() {
if (PINS.ramping) {
restServer.send(403, "text/json", "{\"success\": 0, \"reason\": \"ramping ongoing\"}");
restServer.send(403, "application/json",
"{\"success\": 0, \"reason\": \"ramping ongoing\"}");
return;
}
String output;
......@@ -247,12 +250,13 @@ void powerGroup() {
}
http_msg += "\n}";
restServer.send(success ? 200 : 406, "text/json", http_msg);
restServer.send(success ? 200 : 406, "application/json", http_msg);
}
void powerAllOff() {
if (PINS.ramping) {
restServer.send(403, "text/json", "{\"success\": 0, \"reason\": \"ramping ongoing\"}");
restServer.send(403, "application/json",
"{\"success\": 0, \"reason\": \"ramping ongoing\"}");
return;
}
String group;
......@@ -290,7 +294,7 @@ void powerAllOff() {
// }
http_msg += "\n}";
restServer.send(success ? 200 : 406, "text/json", http_msg);
restServer.send(success ? 200 : 406, "application/json", http_msg);
}
void pollMPODChannel() {
......@@ -328,5 +332,5 @@ void pollMPODChannel() {
http_msg += ret;
http_msg += "}";
restServer.send(channel ? 200 : 406, "text/json", http_msg);
restServer.send(channel ? 200 : 406, "application/json", http_msg);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment