iface-modem-signal: launch explicit signal query after setting up thresholds

This commit is contained in:
Aleksander Morgado
2023-05-11 11:15:20 +00:00
parent 1564b54cff
commit d3deb0ef0b

View File

@@ -249,7 +249,7 @@ load_values_ready (MMIfaceModemSignal *self,
} }
static gboolean static gboolean
polling_context_cb (MMIfaceModemSignal *self) query_signal_values (MMIfaceModemSignal *self)
{ {
MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->load_values ( MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->load_values (
self, self,
@@ -285,10 +285,10 @@ polling_restart (MMIfaceModemSignal *self)
/* Start/restart polling */ /* Start/restart polling */
if (priv->timeout_source) if (priv->timeout_source)
g_source_remove (priv->timeout_source); g_source_remove (priv->timeout_source);
priv->timeout_source = g_timeout_add_seconds (priv->rate, (GSourceFunc) polling_context_cb, self); priv->timeout_source = g_timeout_add_seconds (priv->rate, (GSourceFunc) query_signal_values, self);
/* Also launch right away */ /* Also launch right away */
polling_context_cb (self); query_signal_values (self);
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -311,8 +311,11 @@ setup_thresholds_ready (MMIfaceModemSignal *self,
if (!MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->setup_thresholds_finish (self, res, &error)) if (!MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->setup_thresholds_finish (self, res, &error))
g_task_return_error (task, error); g_task_return_error (task, error);
else else {
/* launch a query right away */
query_signal_values (self);
g_task_return_boolean (task, TRUE); g_task_return_boolean (task, TRUE);
}
g_object_unref (task); g_object_unref (task);
} }