iface-modem-signal: send a query after threshold set up
After the setup of threshold for signal state notifications, trigger a query of the current signal state values.
This commit is contained in:

committed by
Aleksander Morgado

parent
9007d7999d
commit
17ed63637f
@@ -6759,6 +6759,18 @@ modem_signal_load_values (MMIfaceModemSignal *self,
|
||||
|
||||
task = g_task_new (self, NULL, callback, user_data);
|
||||
|
||||
if (mbim_device_check_ms_mbimex_version (device, 2, 0)) {
|
||||
message = mbim_message_signal_state_query_new (NULL);
|
||||
mbim_device_command (device,
|
||||
message,
|
||||
5,
|
||||
NULL,
|
||||
(GAsyncReadyCallback)signal_state_query_ready,
|
||||
task);
|
||||
mbim_message_unref (message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MM_BROADBAND_MODEM_MBIM (self)->priv->is_atds_signal_supported) {
|
||||
message = mbim_message_atds_signal_query_new (NULL);
|
||||
mbim_device_command (device,
|
||||
|
@@ -249,7 +249,7 @@ load_values_ready (MMIfaceModemSignal *self,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
polling_context_cb (MMIfaceModemSignal *self)
|
||||
query_signal_values (MMIfaceModemSignal *self)
|
||||
{
|
||||
MM_IFACE_MODEM_SIGNAL_GET_INTERFACE (self)->load_values (
|
||||
self,
|
||||
@@ -285,10 +285,10 @@ polling_restart (MMIfaceModemSignal *self)
|
||||
/* Start/restart polling */
|
||||
if (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 */
|
||||
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))
|
||||
g_task_return_error (task, error);
|
||||
else
|
||||
else {
|
||||
/* launch a query right away */
|
||||
query_signal_values (self);
|
||||
g_task_return_boolean (task, TRUE);
|
||||
}
|
||||
g_object_unref (task);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user