'button list' only prints state once and exits so verifying a button mapping on a mobile device is not practical. Therefore the new subcommand loops the input states and prints it live.
Signed-off-by: Petr Hodina <[email protected]> --- Changes in v2: - Add Ctrl-C handling. Timeout of 0 now runs until Ctrl-C - Use ANSI_* macros from ansi.h and plain \n instead of raw escapes - Share state printing with "button list" (on/off/<inactive>/Error N) and probe all buttons once before the loop - Match "monitor" with strcmp() and reject an invalid timeout - Add documentation and sandbox tests - Link to v1: https://patch.msgid.link/[email protected] --- Petr Hodina (3): cmd: button: add live monitor subcommand doc: button: document monitor subcommand test: button: add test for monitor subcommand cmd/button.c | 104 +++++++++++++++++++++++++++++++++++++++---- doc/usage/cmd/button.rst | 16 +++++++ test/py/tests/test_button.py | 20 +++++++++ 3 files changed, 131 insertions(+), 9 deletions(-) --- base-commit: ece349ade2973e220f524ce59e59711cc919263f change-id: 20261002-b4-button-live-monitor-87b27d864cb6 Best regards, -- Petr Hodina <[email protected]>
