aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2024-03-07 14:09:28 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2024-03-12 10:15:59 +0000
commit07f1f5864204dfdf455067def863fcd20c8c6a26 (patch)
treeb2d3869a468de9bce1405b394b832aa711865806 /src/mm-modem-helpers.h
parent311d6f389e74899bc1790928bb44e8361e411a1b (diff)
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.
Diffstat (limited to 'src/mm-modem-helpers.h')
-rw-r--r--src/mm-modem-helpers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h
index 7420ba1a..eb285c1b 100644
--- a/src/mm-modem-helpers.h
+++ b/src/mm-modem-helpers.h
@@ -79,6 +79,12 @@ gchar *mm_bcd_to_string (const guint8 *bcd,
gsize bcd_len,
gboolean low_nybble_first);
+/*
+ * Convert a string into a quoted and escaped string. Returns a new
+ * allocated string. Follows ITU V.250 5.4.2.2 "String constants".
+ */
+gchar *mm_at_quote_string (const gchar *input);
+
/*****************************************************************************/
/* VOICE specific helpers and utilities */
/*****************************************************************************/