diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-05-16 18:18:01 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2019-06-03 03:50:22 +0000 |
commit | 72bdb1b36576f21533b93222ac950734c04ca03f (patch) | |
tree | 5f17eb95f669e1fc5d2f9e803ab1cacaa9908c37 /src/mm-base-sms.c | |
parent | 8092e301fc55c84a5523a8cb3f75461b53ac2e9a (diff) |
port-serial-at: raw commands always run next
We use the raw commands exclusively when we're sending SMS data to the
device. Until this change, all raw commands were added at the tail of
the queue of pending commands, and that meant that if any unrelated AT
command was interleaved between e.g. our AT+CGMS and the actual SMS
data sent, the operation would have failed.
With this fix, we're making sure that all raw commands are added at
the head of the queue, so we're making sure that the next command
picked after e.g. CGMS is actually the raw SMS data to be sent.
We would be avoiding issues like this one, where an outgoing voice
call attempt gets in the way before we send the SMS data:
[1556246081.786284] (ttyACM2): --> 'AT+CMGS=70<CR>'
[1556246081.814861] (ttyACM2): <-- '<CR><LF>> '
[1556246081.819382] (ttyACM2): --> 'ATD1234567890;<CR>'
[1556246081.839685] (ttyACM2): <-- '<CR><LF>> '
[1556246081.840123] Couldn't start call : 'Couldn't start the call: Unhandled response '> ''
[1556246081.856254] (ttyACM2): --> '0001000D810..............
[1556246081.922470] (ttyACM2): <-- '<CR><LF>+CME ERROR: 4<CR><LF>'
Diffstat (limited to 'src/mm-base-sms.c')
-rw-r--r-- | src/mm-base-sms.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mm-base-sms.c b/src/mm-base-sms.c index 25a02617..e1ee532d 100644 --- a/src/mm-base-sms.c +++ b/src/mm-base-sms.c @@ -1,3 +1,4 @@ + /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This program is free software; you can redistribute it and/or modify @@ -914,7 +915,11 @@ store_ready (MMBaseModem *modem, ctx = g_task_get_task_data (task); - /* Send the actual message data */ + /* Send the actual message data. + * We send the data as 'raw' data because we do NOT want it to + * be treated as an AT command (i.e. we don't want it prefixed + * with AT+ and suffixed with <CR><LF>), plus, we want it to be + * sent right away (not queued after other AT commands). */ mm_base_modem_at_command_raw (ctx->modem, ctx->msg_data, 10, @@ -1131,7 +1136,11 @@ send_generic_ready (MMBaseModem *modem, ctx = g_task_get_task_data (task); - /* Send the actual message data */ + /* Send the actual message data. + * We send the data as 'raw' data because we do NOT want it to + * be treated as an AT command (i.e. we don't want it prefixed + * with AT+ and suffixed with <CR><LF>), plus, we want it to be + * sent right away (not queued after other AT commands). */ mm_base_modem_at_command_raw (ctx->modem, ctx->msg_data, 10, |