From: Pekka Pessi <pekka.pe...@nokia.com> Do not request SetProperty("Online") if the modem is already in desired Online state. --- plugins/ofono.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/plugins/ofono.c b/plugins/ofono.c index 9385f39..2af555d 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -274,6 +274,16 @@ static void set_online_reply(DBusPendingCall *call, void *user_data) static int modem_change_online(char const *path, dbus_bool_t online) { + struct modem_data *modem = g_hash_table_lookup(modem_hash, path); + + if (modem == NULL) + return -ENODEV; + + if (modem->online == (gboolean)online) + return -EALREADY; + + modem->requested_online = (gboolean)online; + return set_property(path, OFONO_MODEM_INTERFACE, "Online", DBUS_TYPE_BOOLEAN, &online, set_online_reply, -- 1.7.1 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman