What it solves
Embedded devices need a small command console over an existing byte stream.
How it works
1Byte stream→2line editor→3command table→4handler→5output callback
Use it when
Add a UART service console
Expose status and diagnostic commands
Drive the shell from an RTT or USB CDC stream
Quick Start
#include "msh.h"
static msh_t shell;
msh_init(&shell,uart_print,NULL);
msh_register(&shell,"status","Show status",cmd_status);
msh_prompt(&shell);
/* Expected terminal: prompt; status prints ok. */Real scenarios
Add a UART service console
A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.
Expose status and diagnostic commands
A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.
Drive the shell from an RTT or USB CDC stream
A fixed-capacity shell parses ASCII commands and calls registered argc/argv handlers.
Engineering evidence
- CMake package and C/C++ consumer examples are documented
Known limits
- ASCII-oriented; no Unicode line editing
- msh_feed is not ISR-safe or reentrant
- Output callbacks are synchronous