|
@@ -16,6 +16,8 @@
|
|
|
|
|
|
#define ISO_nl 0x0a
|
|
|
#define ISO_cr 0x0d
|
|
|
+#define ISO_etx 0x03
|
|
|
+#define ISO_del 0x7f
|
|
|
|
|
|
#define REPEAT_SENSOR_INFO_TIME configTICK_RATE_HZ*5*1
|
|
|
|
|
@@ -193,9 +195,10 @@ void cli_getchar(cli_state_t *s, char incoming_char)
|
|
|
{
|
|
|
s->buf[s->bufptr] = incoming_char;
|
|
|
|
|
|
+ printf("got char: %x\r\n", (unsigned)incoming_char);
|
|
|
bool echo_enabled = true; // FIXME
|
|
|
if(echo_enabled && s->input_state != CLI_AUTH_PASSW){
|
|
|
- if(s->buf[s->bufptr] != 0x03 && s->buf[s->bufptr] != 0x7f){
|
|
|
+ if (s->buf[s->bufptr] != ISO_etx && s->buf[s->bufptr] != ISO_del) {
|
|
|
s->send( s->num_connect, &s->buf[s->bufptr], 1);
|
|
|
}
|
|
|
}
|
|
@@ -215,7 +218,7 @@ void cli_getchar(cli_state_t *s, char incoming_char)
|
|
|
}
|
|
|
cli_input(s);
|
|
|
s->bufptr = 0;
|
|
|
- } else if( s->buf[s->bufptr] == '\b' || s->buf[s->bufptr] == 0x7f) {
|
|
|
+ } else if ( s->buf[s->bufptr] == '\b' || s->buf[s->bufptr] == ISO_del) {
|
|
|
/* Backspace was pressed. Erase the last character in the string - if any. */
|
|
|
s->buf[s->bufptr] = '\0';
|
|
|
if (s->bufptr > 0) {
|
|
@@ -224,7 +227,7 @@ void cli_getchar(cli_state_t *s, char incoming_char)
|
|
|
const char backspace[] = "\b \b";
|
|
|
s->send(s->num_connect, backspace, sizeof(backspace));
|
|
|
}
|
|
|
- } else if (s->buf[s->bufptr] == 0x03){
|
|
|
+ } else if (s->buf[s->bufptr] == ISO_etx){
|
|
|
xTimerStop(s->RepeatSensorInfoTimer, 0);
|
|
|
s->flag_telnet_ip_option = true;
|
|
|
if(s->input_state != CLI_CHANGE_PWD && s->input_state != CLI_CHANGE_PWD_ACK)
|