diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem-cdma.c | 63 | ||||
-rw-r--r-- | src/mm-iface-modem-cdma.h | 17 |
2 files changed, 80 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, diff --git a/src/mm-iface-modem-cdma.h b/src/mm-iface-modem-cdma.h index fd678897..3734c1e7 100644 --- a/src/mm-iface-modem-cdma.h +++ b/src/mm-iface-modem-cdma.h @@ -69,6 +69,15 @@ struct _MMIfaceModemCdma { GAsyncResult *res, GError **error); + + /* Asynchronous enabling of unsolicited events */ + void (*enable_unsolicited_events) (MMIfaceModemCdma *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*enable_unsolicited_events_finish) (MMIfaceModemCdma *self, + GAsyncResult *res, + GError **error); + /* Asynchronous cleaning up of unsolicited events */ void (* cleanup_unsolicited_events) (MMIfaceModemCdma *self, GAsyncReadyCallback callback, @@ -77,6 +86,14 @@ struct _MMIfaceModemCdma { GAsyncResult *res, GError **error); + /* Asynchronous disabling of unsolicited events */ + void (*disable_unsolicited_events) (MMIfaceModemCdma *self, + GAsyncReadyCallback callback, + gpointer user_data); + gboolean (*disable_unsolicited_events_finish) (MMIfaceModemCdma *self, + GAsyncResult *res, + GError **error); + /* OTA activation */ void (* activate) (MMIfaceModemCdma *self, const gchar *carrier, |