cinterion: use BearerCinterionAuthType when possible

This commit is contained in:
Aleksander Morgado
2016-11-23 23:54:41 +01:00
parent d50059ead4
commit 6721c83d07

View File

@@ -194,7 +194,7 @@ verify_connection_state_from_swwan_response (GList *result, GError **error)
/*****************************************************************************/ /*****************************************************************************/
/* Connect - Helper Functions*/ /* Connect - Helper Functions*/
static gint static BearerCinterionAuthType
cinterion_parse_auth_type (MMBearerAllowedAuth mm_auth) cinterion_parse_auth_type (MMBearerAllowedAuth mm_auth)
{ {
switch (mm_auth) { switch (mm_auth) {
@@ -321,11 +321,11 @@ setup_ip_settings (Connect3gppContext *ctx)
static gchar * static gchar *
build_cinterion_auth_string (Connect3gppContext *ctx) build_cinterion_auth_string (Connect3gppContext *ctx)
{ {
const gchar *user = NULL; const gchar *user = NULL;
const gchar *passwd = NULL; const gchar *passwd = NULL;
MMBearerAllowedAuth auth; MMBearerAllowedAuth auth;
gint encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN; BearerCinterionAuthType encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN;
gchar *command = NULL; gchar *command = NULL;
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
passwd = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))); passwd = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
@@ -340,7 +340,7 @@ build_cinterion_auth_string (Connect3gppContext *ctx)
/* Default to no authentication if not specified */ /* Default to no authentication if not specified */
if (encoded_auth == BEARER_CINTERION_AUTH_UNKNOWN) { if (encoded_auth == BEARER_CINTERION_AUTH_UNKNOWN) {
encoded_auth = BEARER_CINTERION_AUTH_NONE; encoded_auth = BEARER_CINTERION_AUTH_NONE;
mm_dbg ("Unable to detect authentication type. Defaulting to:%i", encoded_auth); mm_dbg ("Unable to detect authentication type. Defaulting to 'none'");
} }
/* TODO: Haven't tested this as I can't get a hold of a SIM w/ this feature atm. /* TODO: Haven't tested this as I can't get a hold of a SIM w/ this feature atm.
@@ -351,7 +351,7 @@ build_cinterion_auth_string (Connect3gppContext *ctx)
* ERROR * ERROR
* +CME ERROR: <err> * +CME ERROR: <err>
*/ */
command = g_strdup_printf ("^SGAUTH=%u,%i,%s,%s", command = g_strdup_printf ("^SGAUTH=%u,%d,%s,%s",
usb_interface_configs[ctx->usb_interface_config_index].pdp_context, usb_interface_configs[ctx->usb_interface_config_index].pdp_context,
encoded_auth, encoded_auth,
passwd, passwd,