aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Caruso <ejcaruso@chromium.org>2020-06-12 15:16:50 -0700
committerAleksander Morgado <aleksander@aleksander.es>2020-10-19 20:38:43 +0000
commit9fca0467801d41598666dd63e9394ed806c5a399 (patch)
tree40a57dd67ca0001ffd8d2ad4449b9031e614400c
parent1ed9f7e94e5948f408d1d09ad8c219a594669066 (diff)
mm-base-sim: add EID D-Bus property
This provides a new D-Bus property on the Sim object that exposes the EID of the SIM, if available.
-rw-r--r--docs/reference/libmm-glib/libmm-glib-sections.txt2
-rw-r--r--introspection/org.freedesktop.ModemManager1.Sim.xml7
-rw-r--r--src/mm-base-sim.c19
-rw-r--r--src/mm-base-sim.h8
4 files changed, 36 insertions, 0 deletions
diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt
index 1e283f2c..107cd94d 100644
--- a/docs/reference/libmm-glib/libmm-glib-sections.txt
+++ b/docs/reference/libmm-glib/libmm-glib-sections.txt
@@ -3110,6 +3110,8 @@ MmGdbusSimIface
mm_gdbus_sim_get_active
mm_gdbus_sim_get_imsi
mm_gdbus_sim_dup_imsi
+mm_gdbus_sim_get_eid
+mm_gdbus_sim_dup_eid
mm_gdbus_sim_get_sim_identifier
mm_gdbus_sim_dup_sim_identifier
mm_gdbus_sim_get_operator_identifier
diff --git a/introspection/org.freedesktop.ModemManager1.Sim.xml b/introspection/org.freedesktop.ModemManager1.Sim.xml
index f214ba5f..87891e31 100644
--- a/introspection/org.freedesktop.ModemManager1.Sim.xml
+++ b/introspection/org.freedesktop.ModemManager1.Sim.xml
@@ -96,6 +96,13 @@
<property name="Imsi" type="s" access="read" />
<!--
+ Eid:
+
+ The EID of the SIM card, if any.
+ -->
+ <property name="Eid" type="s" access="read" />
+
+ <!--
OperatorId:
The ID of the network operator that issued the SIM card,
diff --git a/src/mm-base-sim.c b/src/mm-base-sim.c
index c9d24fbb..d692554d 100644
--- a/src/mm-base-sim.c
+++ b/src/mm-base-sim.c
@@ -1503,6 +1503,7 @@ typedef enum {
INITIALIZATION_STEP_WAIT_READY,
INITIALIZATION_STEP_SIM_IDENTIFIER,
INITIALIZATION_STEP_IMSI,
+ INITIALIZATION_STEP_EID,
INITIALIZATION_STEP_OPERATOR_ID,
INITIALIZATION_STEP_OPERATOR_NAME,
INITIALIZATION_STEP_EMERGENCY_NUMBERS,
@@ -1631,6 +1632,7 @@ init_load_emergency_numbers_ready (MMBaseSim *self,
}
STR_REPLY_READY_FN (imsi, "IMSI")
+STR_REPLY_READY_FN (eid, "EID")
STR_REPLY_READY_FN (operator_identifier, "operator identifier")
STR_REPLY_READY_FN (operator_name, "operator name")
@@ -1714,6 +1716,22 @@ interface_initialization_step (GTask *task)
ctx->step++;
/* Fall through */
+ case INITIALIZATION_STEP_EID:
+ /* EID is meant to be loaded only once during the whole
+ * lifetime of the modem. Therefore, if we already have them loaded,
+ * don't try to load them again. */
+ if (mm_gdbus_sim_get_eid (MM_GDBUS_SIM (self)) == NULL &&
+ MM_BASE_SIM_GET_CLASS (self)->load_eid &&
+ MM_BASE_SIM_GET_CLASS (self)->load_eid_finish) {
+ MM_BASE_SIM_GET_CLASS (self)->load_eid (
+ self,
+ (GAsyncReadyCallback)init_load_eid_ready,
+ task);
+ return;
+ }
+ ctx->step++;
+ /* Fall through */
+
case INITIALIZATION_STEP_OPERATOR_ID:
/* Operator ID is meant to be loaded only once during the whole
* lifetime of the modem. Therefore, if we already have them loaded,
@@ -1807,6 +1825,7 @@ initable_init_async (GAsyncInitable *initable,
{
mm_gdbus_sim_set_sim_identifier (MM_GDBUS_SIM (initable), NULL);
mm_gdbus_sim_set_imsi (MM_GDBUS_SIM (initable), NULL);
+ mm_gdbus_sim_set_eid (MM_GDBUS_SIM (initable), NULL);
mm_gdbus_sim_set_operator_identifier (MM_GDBUS_SIM (initable), NULL);
mm_gdbus_sim_set_operator_name (MM_GDBUS_SIM (initable), NULL);
diff --git a/src/mm-base-sim.h b/src/mm-base-sim.h
index 9a290e0b..7e860f56 100644
--- a/src/mm-base-sim.h
+++ b/src/mm-base-sim.h
@@ -76,6 +76,14 @@ struct _MMBaseSimClass {
GAsyncResult *res,
GError **error);
+ /* Load EID (async) */
+ void (* load_eid) (MMBaseSim *self,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ gchar * (* load_eid_finish) (MMBaseSim *self,
+ GAsyncResult *res,
+ GError **error);
+
/* Load operator identifier (async) */
void (* load_operator_identifier) (MMBaseSim *self,
GAsyncReadyCallback callback,