From 561e189c78662d41b7d59a89b4af42c71c1d7aa9 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Fri, 18 Dec 2020 19:06:06 +0100 Subject: [PATCH] logging --- cube/User/Src/cmdHandler.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cube/User/Src/cmdHandler.c b/cube/User/Src/cmdHandler.c index 8865246..6985011 100644 --- a/cube/User/Src/cmdHandler.c +++ b/cube/User/Src/cmdHandler.c @@ -91,7 +91,7 @@ static int8_t cmdExecuteCommand(uint8_t *cmdLine, bool resetSpecialModes) { commands = getConfigCommands(); } - coloredMsg(LOG_YELLOW, false, "ch cec cmdLine is %s", cmdLine);; + coloredMsg(LOG_YELLOW, true, "ch cec cmdLine is %s", cmdLine);; #define MAX_NUM_OF_ARGS 8 char *args[MAX_NUM_OF_TASKS]; @@ -107,7 +107,7 @@ static int8_t cmdExecuteCommand(uint8_t *cmdLine, bool resetSpecialModes) { char *cmd = args[0]; int8_t retCode = 0; - coloredMsg(LOG_YELLOW, false, "ch cec cmd is %s, number of arguments %d", cmd, argc); + coloredMsg(LOG_YELLOW, true, "ch cec cmd is %s, number of arguments %d", cmd, argc); if (0 == strcmp(cmd, "quit")) { messageToSend = (uint8_t*)GOODBYE_MSG; @@ -157,6 +157,7 @@ static int8_t cmdExecuteCommand(uint8_t *cmdLine, bool resetSpecialModes) { } if (messageToSend) { + coloredMsg(LOG_YELLOW, true, "ch cec command finally returns %s", messageToSend); send(CMD_SOCK, messageToSend, strlen((char*)messageToSend)); } @@ -329,6 +330,9 @@ static void cmdHandlerEngine(void *handle) { case CH_ERROR: coloredMsg(LOG_YELLOW, true, "ch che error state, will stop here"); schDel(cmdHandlerEngine, NULL); + state = CH_INIT; + schAdd(cmdHandlerEngine, NULL, 5000, 100); + coloredMsg(LOG_YELLOW, true, "ch che restart command handler engine in 5s"); break; } }