Merge pull request #329 from DrDoof/feat/cmd-output

httpd: answer /cmd with what the command printed, and show it in the console tab
This commit is contained in:
René van Dorst authored and GitHub committed 2026-09-03 20:33:26 +00:00
commit 6c43091b7a
7 files changed
+63 -6

No files matched your search

+17
View File
@@ -240,8 +240,25 @@ void isr_serial(void) __interrupt(4)
}
/* Set by the httpd while it runs a command that arrived over the network, so
* that everything the command prints lands in the response as well. */
__xdata uint8_t cmd_capture;
extern __xdata uint8_t outbuf[TCP_OUTBUF_SIZE];
extern __xdata uint16_t slen;
void write_char_no_syslog(char c)
{
/* Capturing sits here rather than in write_char() so that the messages
* printed through print_string_no_syslog() are captured too: those are
* the replies of the syslog commands, which must not generate a syslog
* packet but do belong in the answer to a command sent over HTTP. */
if (cmd_capture) {
if (slen < TCP_OUTBUF_SIZE - sizeof(CMD_TRUNCATED))
outbuf[slen++] = c;
else
cmd_capture = 2; /* out of room, httpd says so */
}
do {
} while (tx_buf_empty == 0);
if (c =='\n') {