部分测试代码如下
char responseWithIds[128] = {0}; UART2_write(uartHandle, "1\n", 2, NULL); sprintf(responseWithIds, "ADDR:112233445566\n"); UART2_write(uartHandle, "2\n", 2, NULL); len = strlen(responseWithIds); UART2_write(uartHandle, "3\n", 2, NULL); UART2_write(uartHandle, "00112233445566778899\n", 21, NULL); UART2_write(uartHandle, responseWithIds, len, NULL); UART2_write(uartHandle, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n", 27, NULL);
输出结果如下
缺少了“ADDR:112233445566\n”
查看变量信息是存在的
如果我debug,单步执行,就可以得到想要的输出
请问我该如何处理才能得到正确的输出?