diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-06 10:43:54 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-06 10:43:54 -0800 |
commit | 201295b65e4e9cf3686ee29673f7738d2810dd16 (patch) | |
tree | 3781c31bf0802f83db59ced9bedf09640f91bdf8 | |
parent | 54c1d069eb688f60cc721fb435953dfaebcfa6d7 (diff) |
gsm: use secondary serial port while connected
For registration updates and signal strength.
-rw-r--r-- | src/mm-generic-gsm.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c index 37ad5a9e..d33c7ec3 100644 --- a/src/mm-generic-gsm.c +++ b/src/mm-generic-gsm.c @@ -674,6 +674,23 @@ mm_generic_gsm_enable_complete (MMGenericGsm *modem, } priv = MM_GENERIC_GSM_GET_PRIVATE (modem); + + /* Open the second port here if the modem has one. We'll use it for + * signal strength and registration updates when the device is connected, + * but also many devices will send unsolicited registration or other + * messages to the secondary port but not the primary. + */ + if (priv->secondary) { + if (!mm_serial_port_open (priv->secondary, &error)) { + if (mm_options_debug ()) { + g_warning ("%s: error opening secondary port: (%d) %s", + __func__, + error ? error->code : -1, + error && error->message ? error->message : "(unknown)"); + } + } + } + mm_serial_port_queue_command (priv->primary, "+CREG=2", 3, creg2_done, info); } @@ -884,6 +901,10 @@ disable (MMModem *modem, priv->access_tech[0] = -1; priv->access_tech[1] = -1; + /* Close the secondary port if its open */ + if (priv->secondary && mm_serial_port_is_open (priv->secondary)) + mm_serial_port_close (priv->secondary); + info = mm_callback_info_new (modem, callback, user_data); /* Cache the previous state so we can reset it if the operation fails */ |