sms: common timeout of 180s for the send operation

On low signal quality conditions, the process of sending the SMS to
the network may take a really long time, way more than the 30s used as
default in some implementations.

We now define a common timeout value of 180s for this operation in all
protocols.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/328
This commit is contained in:
Aleksander Morgado
2021-03-04 18:32:56 +01:00
parent 5d176a1e61
commit 55d60f3c12
4 changed files with 16 additions and 6 deletions

View File

@@ -1145,7 +1145,7 @@ send_generic_ready (MMBaseModem *modem,
* sent right away (not queued after other AT commands). */ * sent right away (not queued after other AT commands). */
mm_base_modem_at_command_raw (ctx->modem, mm_base_modem_at_command_raw (ctx->modem,
ctx->msg_data, ctx->msg_data,
60, MM_BASE_SMS_DEFAULT_SEND_TIMEOUT,
FALSE, FALSE,
(GAsyncReadyCallback)send_generic_msg_data_ready, (GAsyncReadyCallback)send_generic_msg_data_ready,
task); task);
@@ -1219,7 +1219,7 @@ sms_send_next_part (GTask *task)
mm_sms_part_get_index ((MMSmsPart *)ctx->current->data)); mm_sms_part_get_index ((MMSmsPart *)ctx->current->data));
mm_base_modem_at_command (ctx->modem, mm_base_modem_at_command (ctx->modem,
cmd, cmd,
60, MM_BASE_SMS_DEFAULT_SEND_TIMEOUT,
FALSE, FALSE,
(GAsyncReadyCallback)send_from_storage_ready, (GAsyncReadyCallback)send_from_storage_ready,
task); task);
@@ -1245,9 +1245,11 @@ sms_send_next_part (GTask *task)
g_assert (cmd != NULL); g_assert (cmd != NULL);
g_assert (ctx->msg_data != NULL); g_assert (ctx->msg_data != NULL);
/* no network involved in this initial AT command, so lower timeout */
mm_base_modem_at_command (ctx->modem, mm_base_modem_at_command (ctx->modem,
cmd, cmd,
60, 10,
FALSE, FALSE,
(GAsyncReadyCallback)send_generic_ready, (GAsyncReadyCallback)send_generic_ready,
task); task);

View File

@@ -27,6 +27,14 @@
#include "mm-sms-part.h" #include "mm-sms-part.h"
#include "mm-base-modem.h" #include "mm-base-modem.h"
/*****************************************************************************/
/* Default timeout value to be used when sending a SMS, long enough so that the
* operation succeeds or fails under low signal conditions. */
#define MM_BASE_SMS_DEFAULT_SEND_TIMEOUT 180
/*****************************************************************************/
#define MM_TYPE_BASE_SMS (mm_base_sms_get_type ()) #define MM_TYPE_BASE_SMS (mm_base_sms_get_type ())
#define MM_BASE_SMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_SMS, MMBaseSms)) #define MM_BASE_SMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_SMS, MMBaseSms))
#define MM_BASE_SMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_SMS, MMBaseSmsClass)) #define MM_BASE_SMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_SMS, MMBaseSmsClass))

View File

@@ -175,7 +175,7 @@ sms_send_next_part (GTask *task)
NULL); NULL);
mbim_device_command (ctx->device, mbim_device_command (ctx->device,
message, message,
30, MM_BASE_SMS_DEFAULT_SEND_TIMEOUT,
NULL, NULL,
(GAsyncReadyCallback)sms_send_set_ready, (GAsyncReadyCallback)sms_send_set_ready,
task); task);

View File

@@ -437,7 +437,7 @@ sms_send_generic (GTask *task)
qmi_client_wms_raw_send (ctx->client, qmi_client_wms_raw_send (ctx->client,
input, input,
30, MM_BASE_SMS_DEFAULT_SEND_TIMEOUT,
NULL, NULL,
(GAsyncReadyCallback)send_generic_ready, (GAsyncReadyCallback)send_generic_ready,
task); task);
@@ -565,7 +565,7 @@ sms_send_from_storage (GTask *task)
qmi_client_wms_send_from_memory_storage ( qmi_client_wms_send_from_memory_storage (
ctx->client, ctx->client,
input, input,
30, MM_BASE_SMS_DEFAULT_SEND_TIMEOUT,
NULL, NULL,
(GAsyncReadyCallback)send_from_storage_ready, (GAsyncReadyCallback)send_from_storage_ready,
task); task);