diff options
-rw-r--r-- | plugins/cinterion/mm-broadband-bearer-cinterion.c | 19 | ||||
-rw-r--r-- | plugins/cinterion/mm-broadband-modem-cinterion.c | 8 | ||||
-rw-r--r-- | plugins/cinterion/mm-broadband-modem-cinterion.h | 3 |
3 files changed, 28 insertions, 2 deletions
diff --git a/plugins/cinterion/mm-broadband-bearer-cinterion.c b/plugins/cinterion/mm-broadband-bearer-cinterion.c index 676bbbd9..fa4c3ef6 100644 --- a/plugins/cinterion/mm-broadband-bearer-cinterion.c +++ b/plugins/cinterion/mm-broadband-bearer-cinterion.c @@ -197,9 +197,13 @@ parse_auth_type (MMBearerAllowedAuth mm_auth) } } -/* AT^SGAUTH=<cid>[, <auth_type>[, <passwd>, <user>]] */ +/* Cinterion authentication is done with the command AT^SGAUTH, + whose syntax depends on the modem family, as follow: + - AT^SGAUTH=<cid>[, <auth_type>[, <user>, <passwd>]] for the IMT family + - AT^SGAUTH=<cid>[, <auth_type>[, <passwd>, <user>]] for the rest */ static gchar * build_auth_string (MMBroadbandBearerCinterion *self, + MMCinterionModemFamily modem_family, MMBearerProperties *config, guint cid) { @@ -241,6 +245,13 @@ build_auth_string (MMBroadbandBearerCinterion *self, quoted_user = mm_port_serial_at_quote_string (user ? user : ""); quoted_passwd = mm_port_serial_at_quote_string (passwd ? passwd : ""); + if (modem_family == MM_CINTERION_MODEM_FAMILY_IMT) + return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s", + cid, + encoded_auth, + quoted_user, + quoted_passwd); + return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s", cid, encoded_auth, @@ -409,7 +420,11 @@ dial_3gpp_context_step (GTask *task) case DIAL_3GPP_CONTEXT_STEP_AUTH: { gchar *command; - command = build_auth_string (self, mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)), ctx->cid); + command = build_auth_string (self, + mm_broadband_modem_cinterion_get_family (MM_BROADBAND_MODEM_CINTERION (self)), + mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)), + ctx->cid); + if (command) { mm_obj_dbg (self, "dial step %u/%u: authenticating...", ctx->step, DIAL_3GPP_CONTEXT_STEP_LAST); /* Send SGAUTH write, if User & Pass are provided. diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.c b/plugins/cinterion/mm-broadband-modem-cinterion.c index de36fcbc..0e42083f 100644 --- a/plugins/cinterion/mm-broadband-modem-cinterion.c +++ b/plugins/cinterion/mm-broadband-modem-cinterion.c @@ -105,6 +105,14 @@ struct _MMBroadbandModemCinterionPrivate { MMBaseModemAtCommandAlloc *cmds; }; +MMCinterionModemFamily +mm_broadband_modem_cinterion_get_family (MMBroadbandModemCinterion * modem) +{ + g_assert_nonnull (modem); + return modem->priv->modem_family; +} + + /*****************************************************************************/ /* Enable unsolicited events (SMS indications) (Messaging interface) */ diff --git a/plugins/cinterion/mm-broadband-modem-cinterion.h b/plugins/cinterion/mm-broadband-modem-cinterion.h index 47f0dcb4..555ee084 100644 --- a/plugins/cinterion/mm-broadband-modem-cinterion.h +++ b/plugins/cinterion/mm-broadband-modem-cinterion.h @@ -19,6 +19,7 @@ #define MM_BROADBAND_MODEM_CINTERION_H #include "mm-broadband-modem.h" +#include "mm-modem-helpers-cinterion.h" #define MM_TYPE_BROADBAND_MODEM_CINTERION (mm_broadband_modem_cinterion_get_type ()) #define MM_BROADBAND_MODEM_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_CINTERION, MMBroadbandModemCinterion)) @@ -48,4 +49,6 @@ MMBroadbandModemCinterion *mm_broadband_modem_cinterion_new (const gchar *device guint16 vendor_id, guint16 product_id); +MMCinterionModemFamily mm_broadband_modem_cinterion_get_family (MMBroadbandModemCinterion * modem); + #endif /* MM_BROADBAND_MODEM_CINTERION_H */ |