diff options
Diffstat (limited to 'src/modem.c')
-rw-r--r-- | src/modem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modem.c b/src/modem.c index f98079a..3a3f656 100644 --- a/src/modem.c +++ b/src/modem.c @@ -73,8 +73,7 @@ #define INPUT_RANGE_CHILD 64 #define OUTPUT_RANGE_CHILD 1024 -#define INIT_AT_COMMANDS 16 -static const char* const init_at_commands[INIT_AT_COMMANDS*2] = { +static const char* const init_at_commands[] = { "\nAT&F\n", /* Reset to fabric defaults */ "OK\r\n", @@ -108,7 +107,7 @@ static const char* const init_at_commands[INIT_AT_COMMANDS*2] = { "ATS23=1\n", "OK\r\n", - "ATS16=1\n", /* send packet size */ + "ATS16=4\n", /* send packet size (set to 4 instead of 1 to avoid a play distortion with a B1) */ "OK\r\n", "AT\n", //S12.3=0\n", /* DCD always on */ @@ -124,6 +123,8 @@ static const char* const init_at_commands[INIT_AT_COMMANDS*2] = { "OK\r\n", }; +#define INIT_AT_COMMANDS ((sizeof(init_at_commands)/sizeof(init_at_commands[0]))/2) + static const char hup_sequence[] = { DLE, DC4, DLE, ETX, 0 }; static const char ath_sequence[] = "\nATH\n"; @@ -251,7 +252,7 @@ static void modem_next_command(struct modem *m) { if (m->command_index == 0) buffio_command(m->buffio, hup_sequence); - else if (m->command_index == 15) { + else if (!strncmp(p, "AT&L", 4)) { char *l = m->listen_msn ? m->listen_msn : "*"; daemon_log(LOG_INFO, "[%s] Listening on '%s'.", m->name, l); snprintf(tmp, sizeof(tmp), p, l); |