From: Daniel Wagner <[email protected]>

The HFP modems should not controlled by the ofono plugin. Such
modems are under the control of a dialer.
---
 plugins/ofono.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/plugins/ofono.c b/plugins/ofono.c
index 7155b7a..3fd0e01 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -98,6 +98,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;
@@ -1214,6 +1215,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;
 
@@ -1334,6 +1338,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;
 
@@ -1436,6 +1443,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;
 
@@ -1523,6 +1533,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;
 
@@ -1673,11 +1686,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) {
@@ -1698,6 +1724,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);
 }
 
-- 
1.7.8.110.g4cb5d1

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to