mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
F-commands to flash and display them
This commit is contained in:
@@ -133,6 +133,14 @@ void Shell::loop_one() {
|
||||
}
|
||||
}
|
||||
|
||||
void Shell::set_command_str(const __FlashStringHelper * str) {
|
||||
line_buffer_ = read_flash_string(str);
|
||||
erase_current_line();
|
||||
prompt_displayed_ = false;
|
||||
display_prompt();
|
||||
process_command();
|
||||
}
|
||||
|
||||
void Shell::loop_normal() {
|
||||
const int input = read_one_char();
|
||||
|
||||
@@ -246,20 +254,17 @@ void Shell::loop_normal() {
|
||||
cursor_ = line_buffer_.length();
|
||||
} else if (esc_ == 11) {
|
||||
// F1 and F10
|
||||
line_buffer_ = "help";
|
||||
process_command();
|
||||
set_command_str(F("help"));
|
||||
} else if (esc_ == 12) {
|
||||
// F2
|
||||
line_buffer_ = "show";
|
||||
process_command();
|
||||
set_command_str(F("show"));
|
||||
} else if (esc_ == 20) {
|
||||
// F9
|
||||
line_buffer_ = "send telegram \"0B \"";
|
||||
line_buffer_ = read_flash_string(F("send telegram \"0B \""));
|
||||
cursor_ = 1;
|
||||
} else if (esc_ == 21) {
|
||||
// F10
|
||||
line_buffer_ = "call system report";
|
||||
process_command();
|
||||
set_command_str(F("call system report"));
|
||||
}
|
||||
esc_ = 0;
|
||||
} else {
|
||||
|
||||
@@ -892,6 +892,7 @@ class Shell : public std::enable_shared_from_this<Shell>, public uuid::log::Hand
|
||||
* @since 0.1.0
|
||||
*/
|
||||
size_t vprintf(const __FlashStringHelper * format, va_list ap);
|
||||
void set_command_str(const __FlashStringHelper * str);
|
||||
|
||||
static const uuid::log::Logger logger_; /*!< uuid::log::Logger instance for shells. @since 0.1.0 */
|
||||
static std::set<std::shared_ptr<Shell>> shells_; /*!< Registered running shells to be executed. @since 0.1.0 */
|
||||
|
||||
Reference in New Issue
Block a user