modem-helpers: rework AT string quote operation and add unit tests
Rework the AT string quote operation to build the output with the GString helper, instead of manually calculating how many bytes we'll need in the output. It just makes it clearer.
This commit is contained in:
@@ -1374,7 +1374,7 @@ set_initial_eps_step (GTask *task)
|
||||
apn = mm_bearer_properties_get_apn (ctx->properties);
|
||||
mm_obj_dbg (self, "context %d with APN '%s' and PDP type '%s'",
|
||||
self->priv->initial_eps_bearer_cid, apn, ip_family_str);
|
||||
quoted_apn = mm_port_serial_at_quote_string (apn);
|
||||
quoted_apn = mm_at_quote_string (apn);
|
||||
apn_cmd = g_strdup_printf ("+CGDCONT=%u,\"%s\",%s",
|
||||
self->priv->initial_eps_bearer_cid, ip_family_str, quoted_apn);
|
||||
mm_base_modem_at_command (
|
||||
|
||||
@@ -1855,8 +1855,8 @@ mm_cinterion_build_auth_string (gpointer log_object,
|
||||
return g_strdup_printf ("^SGAUTH=%u,%d", cid, encoded_auth);
|
||||
}
|
||||
|
||||
quoted_user = mm_port_serial_at_quote_string (user ? user : "");
|
||||
quoted_passwd = mm_port_serial_at_quote_string (passwd ? passwd : "");
|
||||
quoted_user = mm_at_quote_string (user ? user : "");
|
||||
quoted_passwd = mm_at_quote_string (passwd ? passwd : "");
|
||||
|
||||
if (modem_family == MM_CINTERION_MODEM_FAMILY_IMT)
|
||||
return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s",
|
||||
|
||||
Reference in New Issue
Block a user