api,modem-3gpp: new 'InitialEpsBearerSettings' property

This property shows the settings stored in the device to be used
during the initial LTE attach procedure.
This commit is contained in:
Aleksander Morgado
2018-12-07 16:20:53 +00:00
committed by Dan Williams
parent 9c3ac2fb60
commit 8281b5048b
9 changed files with 408 additions and 158 deletions
+44
View File
@@ -2049,6 +2049,7 @@ typedef enum {
INITIALIZATION_STEP_IMEI,
INITIALIZATION_STEP_ENABLED_FACILITY_LOCKS,
INITIALIZATION_STEP_EPS_UE_MODE_OPERATION,
INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS,
INITIALIZATION_STEP_LAST
} InitializationStep;
@@ -2080,6 +2081,36 @@ sim_pin_lock_enabled_cb (MMBaseSim *self,
mm_gdbus_modem3gpp_set_enabled_facility_locks (skeleton, facilities);
}
static void
load_initial_eps_bearer_settings_ready (MMIfaceModem3gpp *self,
GAsyncResult *res,
GTask *task)
{
InitializationContext *ctx;
MMBearerProperties *config;
GError *error = NULL;
ctx = g_task_get_task_data (task);
config = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish (self, res, &error);
if (!config) {
mm_warn ("couldn't load initial EPS bearer settings: '%s'", error->message);
g_error_free (error);
} else {
GVariant *dictionary;
dictionary = mm_bearer_properties_get_dictionary (config);
mm_gdbus_modem3gpp_set_initial_eps_bearer_settings (ctx->skeleton, dictionary);
g_object_unref (config);
if (dictionary)
g_variant_unref (dictionary);
}
/* Go on to next step */
ctx->step++;
interface_initialization_step (task);
}
static void
load_eps_ue_mode_operation_ready (MMIfaceModem3gpp *self,
GAsyncResult *res,
@@ -2228,6 +2259,19 @@ interface_initialization_step (GTask *task)
/* Fall down to next step */
ctx->step++;
case INITIALIZATION_STEP_EPS_INITIAL_BEARER_SETTINGS:
if (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings &&
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings_finish) {
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->load_initial_eps_bearer_settings (
self,
(GAsyncReadyCallback)load_initial_eps_bearer_settings_ready,
task);
return;
}
/* Fall down to next step */
ctx->step++;
case INITIALIZATION_STEP_LAST:
/* We are done without errors! */
+8
View File
@@ -155,6 +155,14 @@ struct _MMIfaceModem3gpp {
GAsyncResult *res,
GError **error);
/* Asynchronous initial default EPS bearer settings loading */
void (*load_initial_eps_bearer_settings) (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data);
MMBearerProperties * (*load_initial_eps_bearer_settings_finish) (MMIfaceModem3gpp *self,
GAsyncResult *res,
GError **error);
/* Create initial default EPS bearer object */
MMBaseBearer * (*create_initial_eps_bearer) (MMIfaceModem3gpp *self,
MMBearerProperties *properties);