|
@ -39,10 +39,7 @@ |
|
|
|
|
|
|
|
|
HostUI hostui; |
|
|
HostUI hostui; |
|
|
|
|
|
|
|
|
flag_t HostUI::flag; |
|
|
|
|
|
|
|
|
|
|
|
void HostUI::action(FSTR_P const fstr, const bool eol) { |
|
|
void HostUI::action(FSTR_P const fstr, const bool eol) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
SERIAL_ECHOPGM("//action:"); |
|
|
SERIAL_ECHOPGM("//action:"); |
|
|
SERIAL_ECHOF(fstr); |
|
|
SERIAL_ECHOF(fstr); |
|
@ -96,21 +93,18 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
void HostUI::notify(const char * const cstr) { |
|
|
void HostUI::notify(const char * const cstr) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
action(F("notification "), false); |
|
|
action(F("notification "), false); |
|
|
SERIAL_ECHOLN(cstr); |
|
|
SERIAL_ECHOLN(cstr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void HostUI::notify_P(PGM_P const pstr) { |
|
|
void HostUI::notify_P(PGM_P const pstr) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
action(F("notification "), false); |
|
|
action(F("notification "), false); |
|
|
SERIAL_ECHOLNPGM_P(pstr); |
|
|
SERIAL_ECHOLNPGM_P(pstr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) { |
|
|
void HostUI::prompt(FSTR_P const ptype, const bool eol/*=true*/) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
action(F("prompt_"), false); |
|
|
action(F("prompt_"), false); |
|
|
SERIAL_ECHOF(ptype); |
|
|
SERIAL_ECHOF(ptype); |
|
@ -118,7 +112,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) { |
|
|
void HostUI::prompt_plus(FSTR_P const ptype, FSTR_P const fstr, const char extra_char/*='\0'*/) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
prompt(ptype, false); |
|
|
prompt(ptype, false); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
PORT_REDIRECT(SerialMask::All); |
|
|
SERIAL_CHAR(' '); |
|
|
SERIAL_CHAR(' '); |
|
@ -127,7 +120,6 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { |
|
|
SERIAL_EOL(); |
|
|
SERIAL_EOL(); |
|
|
} |
|
|
} |
|
|
void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) { |
|
|
void HostUI::prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char/*='\0'*/) { |
|
|
if (!flag.bits) return; |
|
|
|
|
|
prompt_end(); |
|
|
prompt_end(); |
|
|
host_prompt_reason = reason; |
|
|
host_prompt_reason = reason; |
|
|
prompt_plus(F("begin"), fstr, extra_char); |
|
|
prompt_plus(F("begin"), fstr, extra_char); |
|
|