diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2013-11-19 23:15:48 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-02-13 13:41:01 +0100 |
commit | 2b46f658799e51d3db0ad61bbde45b3426622827 (patch) | |
tree | 9e8d341d7a893288d80f8b6946aa9eee3e4409cf | |
parent | 070f4938f3ff5425f8c4f18f57e79d935ad05b32 (diff) |
base-modem: allow grabbing non-tty AT ports
-rw-r--r-- | src/mm-base-modem.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index bc55ebb1..734d0d05 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -254,6 +254,20 @@ mm_base_modem_grab_port (MMBaseModem *self, if (!port && ptype == MM_PORT_TYPE_MBIM) port = MM_PORT (mm_port_mbim_new (name)); #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) { g_set_error (error, MM_CORE_ERROR, |