mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
#632 - still experimental
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
#include "containers.h"
|
||||
|
||||
#include "console.h"
|
||||
|
||||
#include <uuid/log.h>
|
||||
@@ -44,22 +46,13 @@ class Command {
|
||||
const __FlashStringHelper * cmd_;
|
||||
cmdfunction_p cmdfunction_;
|
||||
cmdfunction_json_p cmdfunction_json_;
|
||||
|
||||
CmdFunction(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_p cmdfunction, cmdfunction_json_p cmdfunction_json)
|
||||
: device_type_(device_type)
|
||||
, cmd_(cmd)
|
||||
, cmdfunction_(cmdfunction)
|
||||
, cmdfunction_json_(cmdfunction_json) {
|
||||
}
|
||||
};
|
||||
|
||||
static std::vector<CmdFunction> commands() {
|
||||
return cmdfunctions_;
|
||||
}
|
||||
static emsesp::array<Command::CmdFunction> * commands();
|
||||
|
||||
static bool call(const uint8_t device_type, const char * cmd, const char * value, const int8_t id, JsonObject & json);
|
||||
static bool call(const uint8_t device_type, const char * cmd, const char * value, const int8_t id);
|
||||
static void add(const uint8_t device_type, const uint8_t device_id, const __FlashStringHelper * cmd, cmdfunction_p cb);
|
||||
static void add(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_p cb);
|
||||
static void add_with_json(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_json_p cb);
|
||||
static void show_all(uuid::console::Shell & shell);
|
||||
static Command::CmdFunction * find_command(const uint8_t device_type, const char * cmd);
|
||||
@@ -68,8 +61,6 @@ class Command {
|
||||
static void show_devices(uuid::console::Shell & shell);
|
||||
static bool device_has_commands(const uint8_t device_type);
|
||||
|
||||
static std::vector<CmdFunction> cmdfunctions_; // list of commands
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user