summaryrefslogtreecommitdiff
path: root/plugins/ofono.c
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2010-08-26 17:26:48 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2010-09-09 20:44:43 +0200
commit076d63263da9b56521c6f9994e2d4c7809d3d6e2 (patch)
tree97d1c02871f952a0972c92fca11237f2269741b0 /plugins/ofono.c
parent99a57ec968021bd821dd6880d342c164e59a178f (diff)
downloadconnman-076d63263da9b56521c6f9994e2d4c7809d3d6e2.tar.gz
connman-076d63263da9b56521c6f9994e2d4c7809d3d6e2.tar.bz2
connman-076d63263da9b56521c6f9994e2d4c7809d3d6e2.zip
ofono: refactor modem_has_gprs()
Diffstat (limited to 'plugins/ofono.c')
-rw-r--r--plugins/ofono.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 092564c1..ec85d9fc 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -927,18 +927,19 @@ static struct modem_data *add_modem(const char *path)
return modem;
}
-static gboolean modem_has_gprs(DBusMessageIter *array)
+static gboolean modem_has_interface(DBusMessageIter *array,
+ char const *interface)
{
DBusMessageIter entry;
dbus_message_iter_recurse(array, &entry);
while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) {
- const char *interface;
+ const char *element;
- dbus_message_iter_get_basic(&entry, &interface);
+ dbus_message_iter_get_basic(&entry, &element);
- if (g_strcmp0(OFONO_GPRS_INTERFACE, interface) == 0)
+ if (g_strcmp0(interface, element) == 0)
return TRUE;
dbus_message_iter_next(&entry);
@@ -947,6 +948,11 @@ static gboolean modem_has_gprs(DBusMessageIter *array)
return FALSE;
}
+static gboolean modem_has_gprs(DBusMessageIter *array)
+{
+ return modem_has_interface(array, OFONO_GPRS_INTERFACE);
+}
+
static void modem_properties_reply(DBusPendingCall *call, void *user_data)
{
DBusMessage *reply;