ESP8266-based WiFi serial modem emulator ROM

AT: Try to help modem detection during autobaud

+24 -5
+24 -5
wifippp.ino
··· 81 81 82 82 /* USR modem mode, ignore input not starting with at or a/ */ 83 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; 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 + } 88 99 } 89 100 return; 90 101 } ··· 845 856 846 857 /* find optional single digit after &command, defaulting to 0 */ 847 858 cmd_num = 0; 848 - if (cmd[0] >= '0' && cmd[0] <= '9') { 859 + if (cmd[0] == '?') { 860 + cmd_num = '?'; 861 + len--; 862 + cmd++; 863 + lcmd++; 864 + } else if (cmd[0] >= '0' && cmd[0] <= '9') { 849 865 if (cmd[1] >= '0' && cmd[1] <= '9') 850 866 /* nothing uses more than 1 digit */ 851 867 goto error; ··· 910 926 default: 911 927 goto error; 912 928 } 929 + break; 930 + case ' ': 931 + /* skip spaces between commands */ 913 932 break; 914 933 default: 915 934 goto error;