tcp stack 6k, move message shuntingYard to scheduler

This commit is contained in:
MichaelDvP
2025-11-03 11:37:24 +01:00
parent c562b88b32
commit 1de647e8a5
4 changed files with 18 additions and 6 deletions

View File

@@ -212,16 +212,20 @@ bool System::command_message(const char * value, const int8_t id, JsonObject out
return false; // must have a string value
}
auto computed_value = compute(value); // process the message via Shunting Yard
EMSESP::webSchedulerService.computed_value.clear();
EMSESP::webSchedulerService.raw_value = value;
for (uint8_t wait = 0; wait < 2000 && !EMSESP::webSchedulerService.raw_value.empty(); wait++) {
delay(1);
}
if (computed_value.length() == 0) {
if (EMSESP::webSchedulerService.computed_value.empty()) {
LOG_WARNING("Message result is empty");
return false;
}
LOG_INFO("Message: %s", computed_value.c_str()); // send to log
Mqtt::queue_publish(F_(message), computed_value); // send to MQTT if enabled
output["api_data"] = computed_value; // send to API
LOG_INFO("Message: %s", EMSESP::webSchedulerService.computed_value.c_str()); // send to log
Mqtt::queue_publish(F_(message), EMSESP::webSchedulerService.computed_value); // send to MQTT if enabled
output["api_data"] = EMSESP::webSchedulerService.computed_value; // send to API
return true;
}