aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-sar.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2022-09-19 10:38:00 +0000
committerAleksander Morgado <aleksander@aleksander.es>2022-09-27 08:28:07 +0000
commit1ea5a577e38ebb5393a7b15e59b585acb659cfce (patch)
tree92f73a9da6944a6424b4a6d51b8b784c43abb6cd /src/mm-iface-modem-sar.c
parent950d36d4ee6c36c606a662a07a877b765c94c11c (diff)
iface-modem-sar: report updated level on SAR enable
The SAR enable operation may be selecting an explicit SAR level by itself, so make sure the protocol implementation reports back to the interface the default level that was used while enabling SAR. No level change is reported in the interface if the SAR is being disabled.
Diffstat (limited to 'src/mm-iface-modem-sar.c')
-rw-r--r--src/mm-iface-modem-sar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mm-iface-modem-sar.c b/src/mm-iface-modem-sar.c
index 84a04969..63105d63 100644
--- a/src/mm-iface-modem-sar.c
+++ b/src/mm-iface-modem-sar.c
@@ -78,12 +78,15 @@ enable_ready (MMIfaceModemSar *self,
HandleEnableContext *ctx)
{
GError *error = NULL;
+ guint power_level = 0;
- if (!MM_IFACE_MODEM_SAR_GET_INTERFACE (ctx->self)->enable_finish (self, res, &error))
+ if (!MM_IFACE_MODEM_SAR_GET_INTERFACE (ctx->self)->enable_finish (self, res, &power_level, &error))
g_dbus_method_invocation_take_error (ctx->invocation, error);
else {
/* Update current features in the interface */
mm_gdbus_modem_sar_set_state (ctx->skeleton, ctx->enable);
+ if (ctx->enable)
+ mm_gdbus_modem_sar_set_power_level (ctx->skeleton, power_level);
mm_gdbus_modem_sar_complete_enable (ctx->skeleton, ctx->invocation);
}