Broadcast host actions

Fixes #18565
This commit is contained in:
Scott Lahteine 2020-07-15 19:58:32 -05:00
parent 0223ca8abb
commit ed3df41a7e

View File

@ -38,6 +38,7 @@
#endif #endif
void host_action(PGM_P const pstr, const bool eol) { void host_action(PGM_P const pstr, const bool eol) {
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_ECHOPGM("//action:"); SERIAL_ECHOPGM("//action:");
serialprintPGM(pstr); serialprintPGM(pstr);
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
@ -74,18 +75,20 @@ void host_action(PGM_P const pstr, const bool eol) {
PromptReason host_prompt_reason = PROMPT_NOT_DEFINED; PromptReason host_prompt_reason = PROMPT_NOT_DEFINED;
void host_action_notify(const char * const message) { void host_action_notify(const char * const message) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("notification "), false); host_action(PSTR("notification "), false);
SERIAL_ECHO(message); SERIAL_ECHOLN(message);
SERIAL_EOL();
} }
void host_action_notify_P(PGM_P const message) { void host_action_notify_P(PGM_P const message) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("notification "), false); host_action(PSTR("notification "), false);
serialprintPGM(message); serialprintPGM(message);
SERIAL_EOL(); SERIAL_EOL();
} }
void host_action_prompt(PGM_P const ptype, const bool eol=true) { void host_action_prompt(PGM_P const ptype, const bool eol=true) {
PORT_REDIRECT(SERIAL_BOTH);
host_action(PSTR("prompt_"), false); host_action(PSTR("prompt_"), false);
serialprintPGM(ptype); serialprintPGM(ptype);
if (eol) SERIAL_EOL(); if (eol) SERIAL_EOL();
@ -93,6 +96,7 @@ void host_action(PGM_P const pstr, const bool eol) {
void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') { void host_action_prompt_plus(PGM_P const ptype, PGM_P const pstr, const char extra_char='\0') {
host_action_prompt(ptype, false); host_action_prompt(ptype, false);
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_CHAR(' '); SERIAL_CHAR(' ');
serialprintPGM(pstr); serialprintPGM(pstr);
if (extra_char != '\0') SERIAL_CHAR(extra_char); if (extra_char != '\0') SERIAL_CHAR(extra_char);