pantech: always prefer the ttyACM port as primary AT port
This commit is contained in:
@@ -45,6 +45,31 @@ create_modem (MMPlugin *self,
|
||||
product));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
grab_port (MMPlugin *self,
|
||||
MMBaseModem *modem,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
MMPortType ptype;
|
||||
MMAtPortFlag pflags = MM_AT_PORT_FLAG_NONE;
|
||||
|
||||
ptype = mm_port_probe_get_port_type (probe);
|
||||
|
||||
/* Always prefer the ttyACM port as PRIMARY AT port */
|
||||
if (ptype == MM_PORT_TYPE_AT &&
|
||||
g_str_has_prefix (mm_port_probe_get_port_name (probe), "ttyACM")) {
|
||||
pflags = MM_AT_PORT_FLAG_PRIMARY;
|
||||
}
|
||||
|
||||
return mm_base_modem_grab_port (modem,
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe),
|
||||
ptype,
|
||||
pflags,
|
||||
error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
G_MODULE_EXPORT MMPlugin *
|
||||
@@ -73,4 +98,5 @@ mm_plugin_pantech_class_init (MMPluginPantechClass *klass)
|
||||
MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
|
||||
|
||||
plugin_class->create_modem = create_modem;
|
||||
plugin_class->grab_port = grab_port;
|
||||
}
|
||||
|
Reference in New Issue
Block a user