aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-08-01 09:59:13 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-08-28 14:59:06 +0000
commit86a183778b5b123f6556ecbe53ec7d06d6e7c575 (patch)
treeb3ba49e4b8d2eb82ecf8bad2713f98faf6c72422 /cli
parent48973e3d72307ca84375d1c7811eb0b04def91ce (diff)
api,sim: new 'Active' property
In preparation for the multi-SIM setup, we need a way to tell whether a given SIM card is active or not in the system. On systems with one single SIM slot, the available SIM card will always be active. On Multi-SIM Single-Standby setups we may have multiple SIM slots with multiple SIM cards, but only one of them will be active at any given time. On Multi-SIM Multi-Standby setups we may have multiple SIM slots with multiple SIM cards that may be active at the same time. E.g. the QMI protocol allows up to 5 different active SIM cards (primary, secondary, tertiary...).
Diffstat (limited to 'cli')
-rw-r--r--cli/mmcli-output.c1
-rw-r--r--cli/mmcli-output.h1
-rw-r--r--cli/mmcli-sim.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c
index 81a402ac..7f68e812 100644
--- a/cli/mmcli-output.c
+++ b/cli/mmcli-output.c
@@ -264,6 +264,7 @@ static FieldInfo field_infos[] = {
[MMC_F_SMS_PROPERTIES_DELIVERY_STATE] = { "sms.properties.delivery-state", "delivery state", MMC_S_SMS_PROPERTIES, },
[MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP] = { "sms.properties.discharge-timestamp", "discharge timestamp", MMC_S_SMS_PROPERTIES, },
[MMC_F_SIM_GENERAL_DBUS_PATH] = { "sim.dbus-path", "path", MMC_S_SIM_GENERAL, },
+ [MMC_F_SIM_PROPERTIES_ACTIVE] = { "sim.properties.active", "active", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_IMSI] = { "sim.properties.imsi", "imsi", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_ICCID] = { "sim.properties.iccid", "iccid", MMC_S_SIM_PROPERTIES, },
[MMC_F_SIM_PROPERTIES_OPERATOR_ID] = { "sim.properties.operator-code", "operator id", MMC_S_SIM_PROPERTIES, },
diff --git a/cli/mmcli-output.h b/cli/mmcli-output.h
index e350b340..0bf40a41 100644
--- a/cli/mmcli-output.h
+++ b/cli/mmcli-output.h
@@ -281,6 +281,7 @@ typedef enum {
MMC_F_SMS_PROPERTIES_DELIVERY_STATE,
MMC_F_SMS_PROPERTIES_DISCH_TIMESTAMP,
MMC_F_SIM_GENERAL_DBUS_PATH,
+ MMC_F_SIM_PROPERTIES_ACTIVE,
MMC_F_SIM_PROPERTIES_IMSI,
MMC_F_SIM_PROPERTIES_ICCID,
MMC_F_SIM_PROPERTIES_OPERATOR_ID,
diff --git a/cli/mmcli-sim.c b/cli/mmcli-sim.c
index efb15df3..e5501ca9 100644
--- a/cli/mmcli-sim.c
+++ b/cli/mmcli-sim.c
@@ -159,6 +159,7 @@ static void
print_sim_info (MMSim *sim)
{
mmcli_output_string (MMC_F_SIM_GENERAL_DBUS_PATH, mm_sim_get_path (sim));
+ mmcli_output_string (MMC_F_SIM_PROPERTIES_ACTIVE, mm_sim_get_active (sim) ? "yes" : "no");
mmcli_output_string (MMC_F_SIM_PROPERTIES_IMSI, mm_sim_get_imsi (sim));
mmcli_output_string (MMC_F_SIM_PROPERTIES_ICCID, mm_sim_get_identifier (sim));
mmcli_output_string (MMC_F_SIM_PROPERTIES_OPERATOR_ID, mm_sim_get_operator_identifier (sim));