broadband-modem-qmi: disable signal/access-tech polling if indications enabled

We can rely on QMI indications when the signal quality and access tech
changes happen, instead of doing explicit polling.

The modem will run the signal quality retrieval once, and then just
rely on indications, with polling disabled:

  ModemManager[278759]: <debug> [1606862198.230492] [modem1] signal strength (lte): -79 dBm
  ModemManager[278759]: <debug> [1606862198.230520] [modem1] signal strength: -79 dBm --> 55%
  ModemManager[278759]: <debug> [1606862198.230583] [modem1] access technology changed (unknown -> lte)
  ModemManager[278759]: <debug> [1606862198.230654] [modem1] signal quality updated (55)
  ModemManager[278759]: <debug> [1606862198.230675] [modem1] periodic signal quality and access technology checks not rescheduled: unneeded or unsupported
  ModemManager[278759]: <debug> [1606862198.230692] [modem1] periodic signal checks disabled

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/231
This commit is contained in:
Aleksander Morgado
2020-12-01 23:26:42 +01:00
parent 47f39c9e1a
commit 3d4dd64dd0

View File

@@ -4781,7 +4781,15 @@ ser_signal_strength_ready (QmiClientNas *client,
output = qmi_client_nas_set_event_report_finish (client, res, &error);
if (!output || !qmi_message_nas_set_event_report_output_get_result (output, &error))
mm_obj_dbg (self, "couldn't set event report: '%s'", error->message);
mm_obj_dbg (self, "couldn't enable signal strength indications: '%s'", error->message);
else {
/* Disable access technology and signal quality polling if we can use the indications */
mm_obj_dbg (self, "signal strength indications enabled: polling disabled");
g_object_set (self,
MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, TRUE,
MM_IFACE_MODEM_PERIODIC_ACCESS_TECH_CHECK_DISABLED, TRUE,
NULL);
}
if (!ctx->client_wds) {
g_task_return_boolean (task, TRUE);
@@ -4842,7 +4850,15 @@ ri_signal_info_ready (QmiClientNas *client,
output = qmi_client_nas_register_indications_finish (client, res, &error);
if (!output || !qmi_message_nas_register_indications_output_get_result (output, &error))
mm_obj_dbg (self, "couldn't register indications: '%s'", error->message);
mm_obj_dbg (self, "couldn't register signal info indications: '%s'", error->message);
else {
/* Disable access technology and signal quality polling if we can use the indications */
mm_obj_dbg (self, "signal strength indications enabled: polling disabled");
g_object_set (self,
MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, TRUE,
MM_IFACE_MODEM_PERIODIC_ACCESS_TECH_CHECK_DISABLED, TRUE,
NULL);
}
if (!ctx->client_wds) {
g_task_return_boolean (task, TRUE);