From 1bf9baabb32812a76960ed7456ad7b0a3f22ee74 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Sat, 4 Dec 2010 00:25:38 +0100 Subject: [PATCH] ofono: Fix signal strength report --- plugins/ofono.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/ofono.c b/plugins/ofono.c index 92e54387..ee474066 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -746,10 +746,8 @@ static void modem_registration_changed(struct modem_data *modem, DBusMessageIter iter; const char *key; int type; - struct { - char const *str; - connman_uint8_t byte; - } value; + connman_uint8_t strength; + char const *name, *status; dbus_message_iter_get_basic(entry, &key); @@ -763,14 +761,16 @@ static void modem_registration_changed(struct modem_data *modem, if (type != DBUS_TYPE_BYTE && type != DBUS_TYPE_STRING) return; - dbus_message_iter_get_basic(&iter, &value); - - if (g_str_equal(key, "Name") && type == DBUS_TYPE_STRING) - modem_operator_name_changed(modem, value.str); - else if (g_str_equal(key, "Strength") && type == DBUS_TYPE_BYTE) - modem_strength_changed(modem, value.byte); - else if (g_str_equal(key, "Status") && type == DBUS_TYPE_STRING) - modem_roaming_changed(modem, value.str); + if (g_str_equal(key, "Name") && type == DBUS_TYPE_STRING) { + dbus_message_iter_get_basic(&iter, &name); + modem_operator_name_changed(modem, name); + } else if (g_str_equal(key, "Strength") && type == DBUS_TYPE_BYTE) { + dbus_message_iter_get_basic(&iter, &strength); + modem_strength_changed(modem, strength); + } else if (g_str_equal(key, "Status") && type == DBUS_TYPE_STRING) { + dbus_message_iter_get_basic(&iter, &status); + modem_roaming_changed(modem, status); + } } -- 2.34.1