diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-26 16:37:22 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-28 15:50:51 +0200 |
commit | 090e3492095cf6d663bfb3f83b3ed0cb19121f1a (patch) | |
tree | 34bd32167e9123809dc060a2a43e97f465aae49f | |
parent | be633fd66bbbdf962a8883d445926b9d1ee3c9ff (diff) |
hso: grab GPS-specific ports
-rw-r--r-- | plugins/option/mm-plugin-hso.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/option/mm-plugin-hso.c b/plugins/option/mm-plugin-hso.c index d6df67f2..bc04265d 100644 --- a/plugins/option/mm-plugin-hso.c +++ b/plugins/option/mm-plugin-hso.c @@ -23,6 +23,7 @@ #include "mm-private-boxed-types.h" #include "mm-plugin-hso.h" #include "mm-broadband-modem-hso.h" +#include "mm-log.h" G_DEFINE_TYPE (MMPluginHso, mm_plugin_hso, MM_TYPE_PLUGIN_BASE) @@ -43,6 +44,7 @@ grab_port (MMPluginBase *base, guint16 vendor = 0, product = 0; MMAtPortFlag pflags = MM_AT_PORT_FLAG_NONE; gchar *devfile; + MMPortType port_type; port = mm_port_probe_get_port (probe); /* transfer none */ subsys = mm_port_probe_get_port_subsys (probe); @@ -82,6 +84,7 @@ grab_port (MMPluginBase *base, } g_free (devfile); + port_type = mm_port_probe_get_port_type (probe); sysfs_path = g_udev_device_get_sysfs_path (port); /* Detect AT port types */ @@ -94,7 +97,14 @@ grab_port (MMPluginBase *base, if (g_str_has_prefix (contents, "Control")) pflags = MM_AT_PORT_FLAG_PRIMARY; else if (g_str_has_prefix (contents, "Application")) - pflags = MM_AT_PORT_FLAG_SECONDARY; /* secondary */ + pflags = MM_AT_PORT_FLAG_SECONDARY; + else if (g_str_has_prefix (contents, "GPS Control")) + pflags = MM_AT_PORT_FLAG_GPS_CONTROL; + else if (g_str_has_prefix (contents, "GPS")) { + /* Not an AT port, but the port to grab GPS traces */ + g_assert (port_type == MM_PORT_TYPE_UNKNOWN); + port_type = MM_PORT_TYPE_GPS; + } g_free (contents); } g_free (hsotype_path); @@ -111,7 +121,7 @@ grab_port (MMPluginBase *base, if (!mm_base_modem_grab_port (existing ? existing : modem, subsys, name, - mm_port_probe_get_port_type (probe), + port_type, pflags, error)) { if (modem) |