iface-modem-cdma: new steps to enable/disable unsolicited events
This commit is contained in:
@@ -1102,6 +1102,7 @@ static void interface_disabling_step (DisablingContext *ctx);
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
DISABLING_STEP_FIRST,
|
DISABLING_STEP_FIRST,
|
||||||
DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
|
DISABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
|
||||||
|
DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS,
|
||||||
DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS,
|
DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS,
|
||||||
DISABLING_STEP_LAST
|
DISABLING_STEP_LAST
|
||||||
} DisablingStep;
|
} DisablingStep;
|
||||||
@@ -1153,6 +1154,24 @@ mm_iface_modem_cdma_disable_finish (MMIfaceModemCdma *self,
|
|||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
cleanup_unsolicited_events_ready (MMIfaceModemCdma *self,
|
cleanup_unsolicited_events_ready (MMIfaceModemCdma *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
@@ -1184,6 +1203,18 @@ interface_disabling_step (DisablingContext *ctx)
|
|||||||
/* Fall down to next step */
|
/* Fall down to next step */
|
||||||
ctx->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:
|
case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS:
|
||||||
if (MM_IFACE_MODEM_CDMA_GET_INTERFACE (ctx->self)->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) {
|
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 {
|
typedef enum {
|
||||||
ENABLING_STEP_FIRST,
|
ENABLING_STEP_FIRST,
|
||||||
ENABLING_STEP_SETUP_UNSOLICITED_EVENTS,
|
ENABLING_STEP_SETUP_UNSOLICITED_EVENTS,
|
||||||
|
ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS,
|
||||||
ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS,
|
ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS,
|
||||||
ENABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
|
ENABLING_STEP_PERIODIC_REGISTRATION_CHECKS,
|
||||||
ENABLING_STEP_LAST
|
ENABLING_STEP_LAST
|
||||||
@@ -1313,6 +1345,25 @@ setup_unsolicited_events_ready (MMIfaceModemCdma *self,
|
|||||||
interface_enabling_step (ctx);
|
interface_enabling_step (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
run_all_registration_checks_ready (MMIfaceModemCdma *self,
|
run_all_registration_checks_ready (MMIfaceModemCdma *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
@@ -1357,6 +1408,18 @@ interface_enabling_step (EnablingContext *ctx)
|
|||||||
/* Fall down to next step */
|
/* Fall down to next step */
|
||||||
ctx->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:
|
case ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS:
|
||||||
mm_iface_modem_cdma_run_all_registration_checks (ctx->self,
|
mm_iface_modem_cdma_run_all_registration_checks (ctx->self,
|
||||||
(GAsyncReadyCallback)run_all_registration_checks_ready,
|
(GAsyncReadyCallback)run_all_registration_checks_ready,
|
||||||
|
@@ -69,6 +69,15 @@ struct _MMIfaceModemCdma {
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
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 */
|
/* Asynchronous cleaning up of unsolicited events */
|
||||||
void (* cleanup_unsolicited_events) (MMIfaceModemCdma *self,
|
void (* cleanup_unsolicited_events) (MMIfaceModemCdma *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
@@ -77,6 +86,14 @@ struct _MMIfaceModemCdma {
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
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 */
|
/* OTA activation */
|
||||||
void (* activate) (MMIfaceModemCdma *self,
|
void (* activate) (MMIfaceModemCdma *self,
|
||||||
const gchar *carrier,
|
const gchar *carrier,
|
||||||
|
Reference in New Issue
Block a user