tangled
alpha
login
or
join now
jcs.org
/
WiFiPPP
0
fork
atom
ESP8266-based WiFi serial modem emulator ROM
0
fork
atom
overview
issues
pulls
pipelines
AT: Try to help modem detection during autobaud
jcs.org
2 years ago
7f9dd2fb
6f8c7332
+24
-5
1 changed file
expand all
collapse all
unified
split
wifippp.ino
+24
-5
wifippp.ino
···
81
82
/* USR modem mode, ignore input not starting with at or a/ */
83
if (curcmdlen == 0 && (b != 'A' && b != 'a')) {
84
-
if (b > 127 && (now - last_autobaud > 2000)) {
85
-
serial_autobaud();
86
-
now = millis();
87
-
last_autobaud = now;
0
0
0
0
0
0
0
0
0
0
0
88
}
89
return;
90
}
···
845
846
/* find optional single digit after &command, defaulting to 0 */
847
cmd_num = 0;
848
-
if (cmd[0] >= '0' && cmd[0] <= '9') {
0
0
0
0
0
849
if (cmd[1] >= '0' && cmd[1] <= '9')
850
/* nothing uses more than 1 digit */
851
goto error;
···
910
default:
911
goto error;
912
}
0
0
0
913
break;
914
default:
915
goto error;
···
81
82
/* USR modem mode, ignore input not starting with at or a/ */
83
if (curcmdlen == 0 && (b != 'A' && b != 'a')) {
84
+
#ifdef AT_TRACE
85
+
syslog.logf(LOG_DEBUG, "bogus char: 0x%x (%c)", b, b);
86
+
#endif
87
+
if (b > 127) {
88
+
/*
89
+
* Help modem auto-detection by just spitting
90
+
* out OK in response to hopefully ATs received
91
+
* during autobaud
92
+
*/
93
+
if (!settings->quiet) {
94
+
if (settings->verbal)
95
+
output("\r\nOK\r\n");
96
+
else
97
+
output("\r0\r");
98
+
}
99
}
100
return;
101
}
···
856
857
/* find optional single digit after &command, defaulting to 0 */
858
cmd_num = 0;
859
+
if (cmd[0] == '?') {
860
+
cmd_num = '?';
861
+
len--;
862
+
cmd++;
863
+
lcmd++;
864
+
} else if (cmd[0] >= '0' && cmd[0] <= '9') {
865
if (cmd[1] >= '0' && cmd[1] <= '9')
866
/* nothing uses more than 1 digit */
867
goto error;
···
926
default:
927
goto error;
928
}
929
+
break;
930
+
case ' ':
931
+
/* skip spaces between commands */
932
break;
933
default:
934
goto error;