aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-cdma.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-31 15:53:50 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-06 20:16:29 +0200
commit01bb5cd6601a2eb47af002579af7978bf503976d (patch)
tree4b326f635957727a03fdbd2500084e3bac89a909 /src/mm-iface-modem-cdma.c
parent779b293387643daf2453dca484a1e35fd284e550 (diff)
iface-modem-cdma: new steps to enable/disable unsolicited events
Diffstat (limited to 'src/mm-iface-modem-cdma.c')
-rw-r--r--src/mm-iface-modem-cdma.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/mm-iface-modem-cdma.c b/src/mm-iface-modem-cdma.c
index 3c3fed8b..32e87771 100644
--- a/src/mm-iface-modem-cdma.c
+++ b/src/mm-iface-modem-cdma.c
@@ -1102,6 +1102,7 @@ static void interface_disabling_step (DisablingContext *ctx);
typedef enum {
DISABLING_STEP_FIRST,
DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
+ DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS,
DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS,
DISABLING_STEP_LAST
} DisablingStep;
@@ -1154,6 +1155,24 @@ mm_iface_modem_cdma_disable_finish (MMIfaceModemCdma *self,
}
static void
+disable_unsolicited_events_ready (MMIfaceModemCdma *self,
+ GAsyncResult *res,
+ DisablingContext *ctx)
+{
+ GError *error = NULL;
+
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error);
+ if (error) {
+ mm_dbg ("Couldn't disable unsolicited events: '%s'", error->message);
+ g_error_free (error);
+ }
+
+ /* Go on to next step */
+ ctx->step++;
+ interface_disabling_step (ctx);
+}
+
+static void
cleanup_unsolicited_events_ready (MMIfaceModemCdma *self,
GAsyncResult *res,
DisablingContext *ctx)
@@ -1184,6 +1203,18 @@ interface_disabling_step (DisablingContext *ctx)
/* Fall down to next step */
ctx->step++;
+ case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS:
+ if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events &&
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events_finish) {
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->disable_unsolicited_events (
+ ctx->self,
+ (GAsyncReadyCallback)disable_unsolicited_events_ready,
+ ctx);
+ return;
+ }
+ /* Fall down to next step */
+ ctx->step++;
+
case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS:
if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events &&
MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->cleanup_unsolicited_events_finish) {
@@ -1224,6 +1255,7 @@ static void interface_enabling_step (EnablingContext *ctx);
typedef enum {
ENABLING_STEP_FIRST,
ENABLING_STEP_SETUP_UNSOLICITED_EVENTS,
+ ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS,
ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS,
ENABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
ENABLING_STEP_LAST
@@ -1314,6 +1346,25 @@ setup_unsolicited_events_ready (MMIfaceModemCdma *self,
}
static void
+enable_unsolicited_events_ready (MMIfaceModemCdma *self,
+ GAsyncResult *res,
+ EnablingContext *ctx)
+{
+ GError *error = NULL;
+
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (self)->enable_unsolicited_events_finish (self, res, &error);
+ if (error) {
+ /* This error shouldn't be treated as critical */
+ mm_dbg ("Enabling unsolicited events failed: '%s'", error->message);
+ g_error_free (error);
+ }
+
+ /* Go on to next step */
+ ctx->step++;
+ interface_enabling_step (ctx);
+}
+
+static void
run_all_registration_checks_ready (MMIfaceModemCdma *self,
GAsyncResult *res,
EnablingContext *ctx)
@@ -1357,6 +1408,18 @@ interface_enabling_step (EnablingContext *ctx)
/* Fall down to next step */
ctx->step++;
+ case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS:
+ if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events &&
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events_finish) {
+ MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->enable_unsolicited_events (
+ ctx->self,
+ (GAsyncReadyCallback)enable_unsolicited_events_ready,
+ ctx);
+ return;
+ }
+ /* Fall down to next step */
+ ctx->step++;
+
case ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS:
mm_iface_modem_cdma_run_all_registration_checks (ctx->self,
(GAsyncReadyCallback)run_all_registration_checks_ready,