aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessy Diamond Exum <jessy.exum@meraki.net>2020-08-26 13:52:04 -0700
committerAleksander Morgado <aleksander@aleksander.es>2020-09-15 07:35:04 +0000
commitb1679b58939fc2563b827d478ac0eea937fd16c8 (patch)
treeb093254b1af349c4a0f94a4475b7a37814e9724c
parentaf5c242e9234a7061ec0d6624e3712153c7c2c6b (diff)
cinterion: Configure the PLAS9 to correctly send Unsolicited Result Codes.
The PLS8 and PLAS9 modems (and likely many others modems supported by this driver) have two AT capable serial ports: The 'MODEM' AT port (default for PPP) and the 'APPLICATION' AT port (used for general control). The PLS8 modem sends URCs to the APPLICATION port by default, while he PLAS9 defaults sending URCs to the MODEM port. To get URCs to behave on both modems, it is necessary to explicitly set the URC reporting port to APPLICATION.
-rw-r--r--plugins/cinterion/mm-broadband-modem-cinterion.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c b/plugins/cinterion/mm-broadband-modem-cinterion.c
index f0bc5a66..bf32020e 100644
--- a/plugins/cinterion/mm-broadband-modem-cinterion.c
+++ b/plugins/cinterion/mm-broadband-modem-cinterion.c
@@ -805,17 +805,17 @@ sind_psinfo_enable_ready (MMBaseModem *_self,
}
static void
-parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *_self,
- GAsyncResult *res,
- GTask *task)
+set_urc_dest_port_ready (MMBaseModem *_self,
+ GAsyncResult *res,
+ GTask *task)
{
MMBroadbandModemCinterion *self;
g_autoptr(GError) error = NULL;
self = MM_BROADBAND_MODEM_CINTERION (_self);
- if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (_self, res, &error))
- mm_obj_warn (self, "couldn't enable parent 3GPP unsolicited events: %s", error->message);
+ if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (_self), res, &error))
+ mm_obj_dbg (self, "couldn't guarantee unsolicited events are sent to the correct port: %s", error->message);
if (self->priv->sind_psinfo_support == FEATURE_SUPPORTED) {
/* Enable access technology update reporting */
@@ -833,6 +833,25 @@ parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *_self,
}
static void
+parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self,
+ GAsyncResult *res,
+ GTask *task)
+{
+ g_autoptr(GError) error = NULL;
+
+ if (!iface_modem_3gpp_parent->enable_unsolicited_events_finish (self, res, &error))
+ mm_obj_warn (self, "couldn't enable parent 3GPP unsolicited events: %s", error->message);
+
+ /* Make sure unsolicited events are sent to an AT port (PLS9 can default to DATA port) */
+ mm_base_modem_at_command (MM_BASE_MODEM (self),
+ "^SCFG=\"URC/DstIfc\",\"app\"",
+ 5,
+ FALSE,
+ (GAsyncReadyCallback)set_urc_dest_port_ready,
+ task);
+}
+
+static void
modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)