diff options
author | Guido Günther <agx@sigxcpu.org> | 2024-08-23 19:52:32 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2024-12-01 21:41:10 +0000 |
commit | b491bc474e8607ca306c84d2c1a95bc664685190 (patch) | |
tree | d7b045072d4fa6c1e87457a8e4857eea31fe233e /cli/mmcli.c | |
parent | 502e0c920f694d6f89371fef33e8212835790669 (diff) |
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>
Diffstat (limited to 'cli/mmcli.c')
-rw-r--r-- | cli/mmcli.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cli/mmcli.c b/cli/mmcli.c index 1e98e51d..062e1714 100644 --- a/cli/mmcli.c +++ b/cli/mmcli.c @@ -269,6 +269,10 @@ main (gint argc, gchar **argv) 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); g_option_context_parse (context, &argc, &argv, 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 (); } |