From 37865d69a2cb427e75e2bf49e686d00f9d6a0efe Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 23 Apr 2017 11:05:09 -0400 Subject: [PATCH] basecmd: Add debugging commands for testing communication Add "debug_ping" and "debug_nop" testing commands. Signed-off-by: Kevin O'Connor --- src/basecmd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/basecmd.c b/src/basecmd.c index 5a4dc853..10b04fad 100644 --- a/src/basecmd.c +++ b/src/basecmd.c @@ -322,6 +322,21 @@ command_debug_write16(uint32_t *args) DECL_COMMAND_FLAGS(command_debug_write16, HF_IN_SHUTDOWN, "debug_write16 addr=%u val=%u"); +void +command_debug_ping(uint32_t *args) +{ + uint8_t len = args[0]; + char *data = (void*)(size_t)args[1]; + sendf("pong data=%*s", len, data); +} +DECL_COMMAND_FLAGS(command_debug_ping, HF_IN_SHUTDOWN, "debug_ping data=%*s"); + +void +command_debug_nop(uint32_t *args) +{ +} +DECL_COMMAND_FLAGS(command_debug_nop, HF_IN_SHUTDOWN, "debug_nop data=%*s"); + /**************************************************************** * Misc commands