added cutting front and back of command

main
Jonas Arnold 4 years ago
parent 465278bde9
commit c2c8f12a05
  1. 5
      ADIS_Sumo_Styger/Sumo/Remote.c

@ -83,9 +83,10 @@ static void RemoteTask(void *pv) {
saveChar = 0; saveChar = 0;
McuShell_SendStr(espMsg, McuShell_GetStdio()->stdOut); McuShell_SendStr(espMsg, McuShell_GetStdio()->stdOut);
McuShell_SendStr((uint8_t*)" okok.\r\n", McuShell_GetStdio()->stdOut); McuShell_SendStr((uint8_t*)" okok.\r\n", McuShell_GetStdio()->stdOut);
if (McuUtility_strncmp(espMsg, espMsgPrefix, sizeof(espMsgPrefix)-1)==0) { /* check prefix */ if (McuUtility_strncmp(espMsg, espMsgPrefix, sizeof(espMsgPrefix)-1) == 0) { /* check prefix */
unsigned char recCmd[32] = {0}; unsigned char recCmd[32] = {0};
memmove(recCmd,espMsg[11],writeIndex); memmove(recCmd,espMsg+strlen(espMsgPrefix),REMOTE_RX_FROM_ESP_QUEUE_LENGTH-strlen(espMsgPrefix)-1);
McuUtility_strCutTail(recCmd, (uint8_t*)"!\0");
McuShell_SendStr(recCmd, McuShell_GetStdio()->stdOut); McuShell_SendStr(recCmd, McuShell_GetStdio()->stdOut);
} }
}else if(writeIndex == McuShell_DEFAULT_SHELL_BUFFER_SIZE && saveChar == 1){ }else if(writeIndex == McuShell_DEFAULT_SHELL_BUFFER_SIZE && saveChar == 1){

Loading…
Cancel
Save