aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2024-01-25 16:28:48 -0600
committerMarcel Holtmann <marcel@holtmann.org>2024-01-26 14:21:17 +0100
commitee0046efd0f36740d0330ffb0146cf4238bff3d6 (patch)
tree125c707c1adcf7146b20deee415030cad8a42e96
parentff19b5985aafe49684129f1c2e9e7afca4ddb106 (diff)
downloadconnman-ee0046efd0f36740d0330ffb0146cf4238bff3d6.tar.gz
ofono: Don't invoke SetProperty unnecessarily
When org.ofono.Modem.Powered property changes, connman invokes the SetProperty method again with the new value. This is pointless and only creates unnecessary DBus traffic. connmand[30]: plugins/ofono.c:modem_set_powered() /phonesim powered 1 connmand[30]: plugins/ofono.c:set_property() /phonesim path /phonesim org.ofono.Modem.Powered connmand[30]: plugins/ofono.c:set_property_reply() /phonesim path /phonesim org.ofono.Modem.Powered connmand[30]: plugins/ofono.c:modem_changed() /phonesim Powered 1 connmand[30]: plugins/ofono.c:modem_set_powered() /phonesim powered 1 connmand[30]: plugins/ofono.c:set_property() /phonesim path /phonesim org.ofono.Modem.Powered connmand[30]: plugins/ofono.c:set_property_reply() /phonesim path /phonesim org.ofono.Modem.Powered Fixes: 054dacc71c6a ("ofono: Set "powered" property according to value")
-rw-r--r--plugins/ofono.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 9d0d44547..65a722fd8 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -1969,12 +1969,11 @@ static gboolean modem_changed(DBusConnection *conn, DBusMessage *message,
dbus_bool_t powered;
dbus_message_iter_get_basic(&value, &powered);
+
modem->powered = powered;
+ modem->set_powered = powered;
DBG("%s Powered %d", modem->path, modem->powered);
-
- /* Set the powered according to the value */
- modem_set_powered(modem, powered);
} else if (g_str_equal(key, "Online")) {
dbus_bool_t online;