base-modem: allow grabbing non-tty AT ports

This commit is contained in:
Aleksander Morgado
2013-11-19 23:15:48 +01:00
parent 070f4938f3
commit 2b46f65879

View File

@@ -254,6 +254,20 @@ mm_base_modem_grab_port (MMBaseModem *self,
if (!port && ptype == MM_PORT_TYPE_MBIM) if (!port && ptype == MM_PORT_TYPE_MBIM)
port = MM_PORT (mm_port_mbim_new (name)); port = MM_PORT (mm_port_mbim_new (name));
#endif #endif
/* Non-serial AT port */
if (!port && ptype == MM_PORT_TYPE_AT) {
port = MM_PORT (mm_port_serial_at_new (name, MM_PORT_SUBSYS_USB));
/* Set common response parser */
mm_port_serial_at_set_response_parser (MM_PORT_SERIAL_AT (port),
mm_serial_parser_v1_parse,
mm_serial_parser_v1_new (),
mm_serial_parser_v1_destroy);
/* Store flags already */
mm_port_serial_at_set_flags (MM_PORT_SERIAL_AT (port), at_pflags);
}
if (!port) { if (!port) {
g_set_error (error, g_set_error (error,
MM_CORE_ERROR, MM_CORE_ERROR,