We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用shell做AT调试时发现shell中使用,和"字符会被认定为参数分隔符,不知道作者在设计的时候这个是基于什么考虑,但是个人认为貌似不太合理,比如传递一个 AT AT+CIPOPEN=0,"114.114.114.114",1883,4001 此类参数时,shell自动分解成多个参数,如
AT AT+CIPOPEN=0,"114.114.114.114",1883,4001
AT AT+CIPOPEN=0 114.114.114.114 1883 4001
这就曲解了原本参数传递的意义,一次建议使用空格做分割符而不是,和“,基于原代码shellEnter函数我做了如下修改
for (unsigned short i = 0; i < shell->length; i++) { if ((quotes != 0 || (*(shell->buffer + i) != ' ' && *(shell->buffer + i) != '\t')) && // *(shell->buffer + i) != ',' && *(shell->buffer + i) != 0) { // if (*(shell->buffer + i) == '\"') // { // quotes = quotes ? 0 : 1; // #if SHELL_AUTO_PRASE == 0 // *(shell->buffer + i) = 0; // continue; // #endif // } if (record == 1) { shell->param[paramCount++] = shell->buffer + i; record = 0; } if (*(shell->buffer + i) == '\\' && *(shell->buffer + i) != 0) { i++; } }
The text was updated successfully, but these errors were encountered:
字符串参数使用双引号包括进去,字符串中包含双引号字符的,使用\转义,逗号作为分隔符是因为原先和另一个shell的兼容
Sorry, something went wrong.
建议保持与linux的shell兼容的语法规则, 一方面大多数人习惯于linux下shell语法,另一方面就是如果使用代码中的规则,没有相应的文档说明的话,很多人可能就比较迷惑了。就像RTT的FINSH,很多时候都是和linux表示兼容
No branches or pull requests
使用shell做AT调试时发现shell中使用,和"字符会被认定为参数分隔符,不知道作者在设计的时候这个是基于什么考虑,但是个人认为貌似不太合理,比如传递一个
AT AT+CIPOPEN=0,"114.114.114.114",1883,4001
此类参数时,shell自动分解成多个参数,如
这就曲解了原本参数传递的意义,一次建议使用空格做分割符而不是,和“,基于原代码shellEnter函数我做了如下修改
The text was updated successfully, but these errors were encountered: