diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-11-23 17:15:22 +0100 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-12-12 17:33:58 +0100 |
commit | 561bb5364d590b903a7526f2d58b6c2127b89140 (patch) | |
tree | 76ffcf2b029051d15ae8f00091914cba08fb9000 /plugins | |
parent | 4ccccee21fae749ce7bdcdc154ba79c45317e93f (diff) | |
download | connman-561bb5364d590b903a7526f2d58b6c2127b89140.tar.gz connman-561bb5364d590b903a7526f2d58b6c2127b89140.tar.bz2 connman-561bb5364d590b903a7526f2d58b6c2127b89140.zip |
ofono: Ignore non 'hardware' modem types.
The HFP modems should not controlled by the ofono plugin. Such
modems are under the control of a dialer.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ofono.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c index 0e26d40e..6ac4f2e7 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -100,6 +100,7 @@ struct modem_data { connman_bool_t powered; connman_bool_t online; uint8_t interfaces; + connman_bool_t ignore; connman_bool_t set_powered; connman_bool_t set_online; @@ -1216,6 +1217,9 @@ static gboolean netreg_changed(DBusConnection *connection, DBusMessage *message, if (modem == NULL) return TRUE; + if (modem->ignore == TRUE) + return TRUE; + if (dbus_message_iter_init(message, &iter) == FALSE) return TRUE; @@ -1336,6 +1340,9 @@ static gboolean cm_changed(DBusConnection *connection, DBusMessage *message, if (modem == NULL) return TRUE; + if (modem->ignore == TRUE) + return TRUE; + if (dbus_message_iter_init(message, &iter) == FALSE) return TRUE; @@ -1438,6 +1445,9 @@ static gboolean sim_changed(DBusConnection *connection, DBusMessage *message, if (modem == NULL) return TRUE; + if (modem->ignore == TRUE) + return TRUE; + if (dbus_message_iter_init(message, &iter) == FALSE) return TRUE; @@ -1525,6 +1535,9 @@ static gboolean modem_changed(DBusConnection *connection, DBusMessage *message, if (modem == NULL) return TRUE; + if (modem->ignore == TRUE) + return TRUE; + if (dbus_message_iter_init(message, &iter) == FALSE) return TRUE; @@ -1675,11 +1688,24 @@ static void add_modem(const char *path, DBusMessageIter *prop) modem->serial = g_strdup(serial); DBG("%s Serial %s", modem->path, modem->serial); + } else if (g_str_equal(key, "Type") == TRUE) { + char *type; + + dbus_message_iter_get_basic(&value, &type); + + DBG("%s Type %s", modem->path, type); + if (g_strcmp0(type, "hardware") != 0) { + DBG("%s Ignore this modem", modem->path); + modem->ignore = TRUE; + } } dbus_message_iter_next(prop); } + if (modem->ignore == TRUE) + return; + if (modem->powered == FALSE) { modem_set_powered(modem); } else if (has_interface(modem->interfaces, OFONO_API_SIM) == TRUE) { @@ -1700,6 +1726,9 @@ static void modem_power_down(gpointer key, gpointer value, gpointer user_data) DBG("%s", modem->path); + if (modem->ignore == TRUE) + return; + modem_set_unpowered(modem); } |