cli: Add support for listing and deleting Cell Broadcast messages

This adds

```
   $ mmcli -m 0 --cell-broadcast-list-cbm
       /org/freedesktop/ModemManager1/CBM/0 (received)
       /org/freedesktop/ModemManager1/CBM/0 (received)

   $ mmcli -m 0 --cell-broadcast-delete-cbm=0
   successfully deleted CBM from modem

   $ mmcli -m 0 --cbm 0
   --------------------------
   General    |         path: /org/freedesktop/ModemManager1/CBM/1
   --------------------------
   Content    |         text: This is a test of the Ontario Alert Ready System. There is no danger to your health or safety
   --------------------------
   Properties |       update: 0
              | message code: 0
```

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2024-12-01 21:41:10 +00:00
committed by Aleksander Morgado
parent 502e0c920f
commit b491bc474e
9 changed files with 848 additions and 0 deletions
+19
View File
@@ -268,6 +268,10 @@ main (gint argc, gchar **argv)
mmcli_sms_get_option_group ());
g_option_context_add_group (context,
mmcli_call_get_option_group ());
g_option_context_add_group (context,
mmcli_modem_cell_broadcast_get_option_group ());
g_option_context_add_group (context,
mmcli_cbm_get_option_group ());
g_option_context_add_group (context,
test_get_option_group ());
g_option_context_add_main_entries (context, main_entries, NULL);
@@ -361,6 +365,10 @@ main (gint argc, gchar **argv)
else
mmcli_call_run_synchronous (connection);
}
/* Cbm options? */
else if (mmcli_cbm_options_enabled ()) {
mmcli_cbm_run_synchronous (connection);
}
/* Modem 3GPP options? */
else if (mmcli_modem_3gpp_options_enabled ()) {
if (async_flag)
@@ -452,6 +460,13 @@ main (gint argc, gchar **argv)
else
mmcli_modem_oma_run_synchronous (connection);
}
/* Modem Cell Broadcast options? */
else if (mmcli_modem_cell_broadcast_options_enabled ()) {
if (async_flag)
mmcli_modem_cell_broadcast_run_asynchronous (connection, cancellable);
else
mmcli_modem_cell_broadcast_run_synchronous (connection);
}
/* Modem options?
* NOTE: let this check be always the last one, as other groups also need
* having a modem specified, and therefore if -m is set, modem options
@@ -500,6 +515,8 @@ main (gint argc, gchar **argv)
mmcli_modem_signal_shutdown ();
} else if (mmcli_modem_oma_options_enabled ()) {
mmcli_modem_oma_shutdown ();
} else if (mmcli_modem_cell_broadcast_options_enabled ()) {
mmcli_modem_cell_broadcast_shutdown ();
} else if (mmcli_sim_options_enabled ()) {
mmcli_sim_shutdown ();
} else if (mmcli_bearer_options_enabled ()) {
@@ -508,6 +525,8 @@ main (gint argc, gchar **argv)
mmcli_sms_shutdown ();
} else if (mmcli_call_options_enabled ()) {
mmcli_call_shutdown ();
} else if (mmcli_cbm_options_enabled ()) {
mmcli_cbm_shutdown ();
} else if (mmcli_modem_options_enabled ()) {
mmcli_modem_shutdown ();
}