aboutsummaryrefslogtreecommitdiff
path: root/plugins/mbm/mm-plugin-mbm.c
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2015-04-08 16:48:29 +0200
committerAleksander Morgado <aleksander@aleksander.es>2015-04-10 08:29:49 +0200
commit534eea345dd8dda96a88559b621ab1a55028cee8 (patch)
tree70e4cf21438999dda256b7ce0eb101814822b03e /plugins/mbm/mm-plugin-mbm.c
parent9293fd2bca31a09fe79334d20aa33fa91eecd044 (diff)
mbm: add GPS location gathering support
The udev rules file is updated according to the list of devices supporting gps features provided by the udev rules file from the mbm-gpsd project. https://bugs.freedesktop.org/show_bug.cgi?id=85008
Diffstat (limited to 'plugins/mbm/mm-plugin-mbm.c')
-rw-r--r--plugins/mbm/mm-plugin-mbm.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/mbm/mm-plugin-mbm.c b/plugins/mbm/mm-plugin-mbm.c
index bef3ab29..e71a0eec 100644
--- a/plugins/mbm/mm-plugin-mbm.c
+++ b/plugins/mbm/mm-plugin-mbm.c
@@ -65,6 +65,35 @@ create_modem (MMPlugin *self,
product));
}
+static gboolean
+grab_port (MMPlugin *self,
+ MMBaseModem *modem,
+ MMPortProbe *probe,
+ GError **error)
+{
+ MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
+ GUdevDevice *port;
+ MMPortType port_type;
+
+ port_type = mm_port_probe_get_port_type (probe);
+ port = mm_port_probe_peek_port (probe);
+
+ if (g_udev_device_get_property_as_boolean (port, "ID_MM_ERICSSON_MBM_GPS_PORT")) {
+ mm_dbg ("(%s/%s) Port flagged as GPS",
+ mm_port_probe_get_port_subsys (probe),
+ mm_port_probe_get_port_name (probe));
+ port_type = MM_PORT_TYPE_GPS;
+ }
+
+ return mm_base_modem_grab_port (modem,
+ mm_port_probe_get_port_subsys (probe),
+ mm_port_probe_get_port_name (probe),
+ mm_port_probe_get_parent_path (probe),
+ port_type,
+ pflags,
+ error);
+}
+
/*****************************************************************************/
G_MODULE_EXPORT MMPlugin *
@@ -97,4 +126,6 @@ mm_plugin_mbm_class_init (MMPluginMbmClass *klass)
MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
plugin_class->create_modem = create_modem;
+ plugin_class->grab_port = grab_port;
+
}