added support for extended setUartOutput forms

This commit is contained in:
Robin Thoni 2024-06-24 08:29:09 +00:00 committed by GitHub
parent b3ca1023e8
commit 1d26bbb986
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,11 +125,14 @@ class LedModeCommand : public Command {
class UartOutputCommand : public Command {
public:
UartOutputCommand(bool active) : active_(active) {
if (active) {
cmd_ = "setUartOutput 1 1";
} else {
cmd_ = "setUartOutput 1 0";
}
cmd_ = std::string("setUartOutput 1 ") + std::to_string((int) active);
};
UartOutputCommand(int type, bool active) : active_(active) {
cmd_ = std::string("setUartOutput ") + std::to_string(type) + " " + std::to_string((int) active);
};
UartOutputCommand(int type, bool active, bool auto_update, int interval) : active_(active) {
cmd_ = std::string("setUartOutput ") + std::to_string(type) + " " + std::to_string((int) active) + " " +
std::to_string((int) auto_update) + " " + std::to_string(interval);
};
uint8_t on_message(std::string &message) override;