From b491bc474e8607ca306c84d2c1a95bc664685190 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 23 Aug 2024 19:52:32 +0200 Subject: cli: Add support for listing and deleting Cell Broadcast messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- cli/mmcli.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'cli/mmcli.c') diff --git a/cli/mmcli.c b/cli/mmcli.c index 1e98e51d..062e1714 100644 --- a/cli/mmcli.c +++ b/cli/mmcli.c @@ -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 (); } -- cgit v1.2.3-70-g09d2