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
Hello,
I am using your library with a NUCLEO-G071RB dev kit and when I use a backspace, the cli buffer is not properly decremented.
For example :
echo on ->backspace -> n will not yield "echo on" but "echo on\127n"
If I add 0x7F (delete ascii char) to the switch case in cli_put(), it works properly.
cli_status_t cli_put(cli_t *cli, char c) { switch(c) { case CMD_TERMINATOR: if(!cmd_pending) { *buf_ptr = '\0'; /* Terminate the msg and reset the msg ptr. */ strcpy(cmd_buf, buf); /* Copy string to command buffer for processing. */ cmd_pending = 1; buf_ptr = buf; /* Reset buf_ptr to beginning. */ } break; case '\b': case 0x7F: // <- If I add this, backspace works properly /* Backspace. Delete character. */ if(buf_ptr > buf) buf_ptr--; break; default: /* Normal character received, add to buffer. */ if((buf_ptr - buf) < MAX_BUF_SIZE) *buf_ptr++ = c; else return CLI_E_BUF_FULL; break; } return CLI_OK; }
I am not sure in which case the delete ascii would be treated differently, so I leave it up to you to add this fix or not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I am using your library with a NUCLEO-G071RB dev kit and when I use a backspace, the cli buffer is not properly decremented.
For example :
echo on ->backspace -> n will not yield "echo on" but "echo on\127n"
If I add 0x7F (delete ascii char) to the switch case in cli_put(), it works properly.
I am not sure in which case the delete ascii would be treated differently, so I leave it up to you to add this fix or not.
The text was updated successfully, but these errors were encountered: