diff --git a/cube/User/Src/cmdHandler.c b/cube/User/Src/cmdHandler.c index ef03d1a..70c0d46 100644 --- a/cube/User/Src/cmdHandler.c +++ b/cube/User/Src/cmdHandler.c @@ -82,7 +82,7 @@ const static cmd_t COMMANDS[] = { // returns -1 to close the connection // returns 1 to toggle to config mode // returns 2 to toggle back to default mode -int8_t cmdExecuteCommand(uint8_t *cmd, bool resetConfigMode) { +int8_t cmdExecuteCommand(uint8_t *cmdLine, bool resetConfigMode) { const static uint8_t HELP_MSG[] = \ "Usage\n\r" \ "\n\r" \ @@ -104,7 +104,8 @@ int8_t cmdExecuteCommand(uint8_t *cmd, bool resetConfigMode) { } int8_t retCode = 0; - coloredMsg(LOG_YELLOW, "cec, cmd is %s", cmd); + char *cmd = strtok(cmdLine, ' '); + coloredMsg(LOG_YELLOW, "cec, cmdLine is %s, cmd is %s", cmdLine); if (0 == strcmp(cmd, "quit")) { messageToSend = GOODBYE_MSG; retCode = -1; @@ -146,7 +147,6 @@ int8_t cmdExecuteCommand(uint8_t *cmd, bool resetConfigMode) { } } - if (messageToSend) { send(CMD_SOCK, messageToSend, strlen(messageToSend)); }