From 4a096c8c5677c82fcc0cdc2d4fc4ec9473e06d92 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 8 Nov 2011 17:00:31 +0100 Subject: [PATCH] base-modem: set v1 serial parser always CDMA modems used to use the v1_e1 serial parser; but we'll try to setup a common one in all modems. --- src/mm-base-modem.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index 976e5f6e..ef7770d2 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -31,6 +31,7 @@ #include "mm-log.h" #include "mm-at-serial-port.h" #include "mm-qcdm-serial-port.h" +#include "mm-serial-parsers.h" G_DEFINE_ABSTRACT_TYPE (MMBaseModem, mm_base_modem, MM_GDBUS_TYPE_OBJECT_SKELETON); @@ -198,30 +199,21 @@ mm_base_modem_grab_port (MMBaseModem *self, /* AT port */ port = MM_PORT (mm_at_serial_port_new (name, ptype)); - /* TODO: setup serial port response parser and unsolicited message handlers */ + /* Set common response parser */ + mm_at_serial_port_set_response_parser (MM_AT_SERIAL_PORT (port), + mm_serial_parser_v1_parse, + mm_serial_parser_v1_new (), + mm_serial_parser_v1_destroy); - /* (CDMA) */ - /* g_object_set (G_OBJECT (port), MM_PORT_CARRIER_DETECT, FALSE, NULL); */ - /* mm_at_serial_port_set_response_parser (MM_AT_SERIAL_PORT (port), */ - /* mm_serial_parser_v1_e1_parse, */ - /* mm_serial_parser_v1_e1_new (), */ - /* mm_serial_parser_v1_e1_destroy); */ - - /* (GSM) */ /* { */ + /* GRegex *regex; */ /* GPtrArray *array; */ - /* int i; */ - - /* mm_at_serial_port_set_response_parser (MM_AT_SERIAL_PORT (port), */ - /* mm_serial_parser_v1_parse, */ - /* mm_serial_parser_v1_new (), */ - /* mm_serial_parser_v1_destroy); */ + /* gint i; */ /* /\* Set up CREG unsolicited message handlers *\/ */ /* array = mm_gsm_creg_regex_get (FALSE); */ /* for (i = 0; i < array->len; i++) { */ /* regex = g_ptr_array_index (array, i); */ - /* mm_at_serial_port_add_unsolicited_msg_handler (MM_AT_SERIAL_PORT (port), regex, reg_state_changed, self, NULL); */ /* } */ /* mm_gsm_creg_regex_destroy (array); */ @@ -239,7 +231,6 @@ mm_base_modem_grab_port (MMBaseModem *self, /* g_regex_unref (regex); */ /* } */ - if (ptype == MM_PORT_TYPE_PRIMARY) { self->priv->primary = g_object_ref (port);