aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-messaging.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-01 09:58:32 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:59 +0100
commit21b1de678d3c457716fd4caffe1b179cb3212a2f (patch)
treee043e047657628bb46d366b6d91854fcd1dd0028 /src/mm-iface-modem-messaging.c
parent14fa4aae1d8c5e07c2eb0e6546e036e868de6b9b (diff)
iface-modem-messaging: allow configuring preferred SMS format
Diffstat (limited to 'src/mm-iface-modem-messaging.c')
-rw-r--r--src/mm-iface-modem-messaging.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c
index 88f23e5e..f6a5c286 100644
--- a/src/mm-iface-modem-messaging.c
+++ b/src/mm-iface-modem-messaging.c
@@ -135,6 +135,7 @@ static void interface_enabling_step (EnablingContext *ctx);
typedef enum {
ENABLING_STEP_FIRST,
+ ENABLING_STEP_SETUP_SMS_FORMAT,
ENABLING_STEP_LAST
} EnablingStep;
@@ -189,6 +190,28 @@ mm_iface_modem_messaging_enable_finish (MMIfaceModemMessaging *self,
}
static void
+setup_sms_format_ready (MMIfaceModemMessaging *self,
+ GAsyncResult *res,
+ EnablingContext *ctx)
+{
+ GError *error = NULL;
+
+ if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format_finish (self,
+ res,
+ &error)) {
+ g_simple_async_result_take_error (ctx->result, error);
+ enabling_context_complete_and_free (ctx);
+ return;
+ }
+
+ mm_dbg ("SMS format correctly setup");
+
+ /* Go on to next step */
+ ctx->step++;
+ interface_enabling_step (ctx);
+}
+
+static void
interface_enabling_step (EnablingContext *ctx)
{
switch (ctx->step) {
@@ -204,6 +227,17 @@ interface_enabling_step (EnablingContext *ctx)
/* Fall down to next step */
ctx->step++;
}
+
+ case ENABLING_STEP_SETUP_SMS_FORMAT:
+ /* Allow setting SMS format to use */
+ if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format &&
+ MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (ctx->self)->setup_sms_format (
+ ctx->self,
+ (GAsyncReadyCallback)setup_sms_format_ready,
+ ctx);
+ return;
+ }
/* Fall down to next step */
ctx->step++;