diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-11-01 21:46:37 +0100 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-11-26 16:51:35 +0000 |
commit | 72674225caf25e680003fb52fa805bf4615ad18f (patch) | |
tree | 3479dd68c7dfa2eba33f761fb7eeb6bce908ad8d /cli | |
parent | a15193b7ca7c1b18f3aa6ee290f1c2866ab40a8c (diff) |
api,modem: deprecate ListBearers() method
This method is completely unnecessary as we have the readable Bearers
property already in place, so let's deprecate it.
Worth noting that the mm_modem_list_bearers() async/sync methods in
libmm-glib were not really using the ListBearers() method anyway, they
are using the property directly. These methods are NOT deprecated,
because they allow us to get a list of MMBearer objects, instead of
just the list of DBus paths that we get when reading the Bearers
property directly.
We also remove --list-bearers from the mmcli operation list as we have
already the same information in the standard modem output.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/mmcli-modem.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 8967b1d0..5fde013b 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -56,7 +56,6 @@ static gboolean set_power_state_off_flag; static gboolean reset_flag; static gchar *factory_reset_str; static gchar *command_str; -static gboolean list_bearers_flag; static gchar *create_bearer_str; static gchar *delete_bearer_str; static gchar *set_current_capabilities_str; @@ -101,10 +100,6 @@ static GOptionEntry entries[] = { "Send an AT command to the modem", "[COMMAND]" }, - { "list-bearers", 0, 0, G_OPTION_ARG_NONE, &list_bearers_flag, - "List packet data bearers available in a given modem", - NULL - }, { "create-bearer", 0, 0, G_OPTION_ARG_STRING, &create_bearer_str, "Create a new packet data bearer in a given modem", "[\"key=value,...\"]" @@ -164,7 +159,6 @@ mmcli_modem_options_enabled (void) set_power_state_low_flag + set_power_state_off_flag + reset_flag + - list_bearers_flag + !!create_bearer_str + !!delete_bearer_str + !!factory_reset_str + @@ -761,48 +755,6 @@ command_get_timeout (MMModem *modem) } static void -list_bearers_process_reply (GList *result, - const GError *error) -{ - if (error) { - g_printerr ("error: couldn't list bearers: '%s'\n", - error->message); - exit (EXIT_FAILURE); - } - - g_print ("\n"); - if (!result) { - g_print ("No bearers were found\n"); - } else { - GList *l; - - g_print ("Found %u bearers:\n", g_list_length (result)); - for (l = result; l; l = g_list_next (l)) { - MMBearer *bearer = MM_BEARER (l->data); - - g_print ("\n"); - print_bearer_short_info (bearer); - g_object_unref (bearer); - } - g_list_free (result); - } -} - -static void -list_bearers_ready (MMModem *modem, - GAsyncResult *result, - gpointer nothing) -{ - GList *operation_result; - GError *error = NULL; - - operation_result = mm_modem_list_bearers_finish (modem, result, &error); - list_bearers_process_reply (operation_result, error); - - mmcli_async_operation_done (); -} - -static void create_bearer_process_reply (MMBearer *bearer, const GError *error) { @@ -1166,16 +1118,6 @@ get_modem_ready (GObject *source, return; } - /* Request to list bearers? */ - if (list_bearers_flag) { - g_debug ("Asynchronously listing bearers in modem..."); - mm_modem_list_bearers (ctx->modem, - ctx->cancellable, - (GAsyncReadyCallback)list_bearers_ready, - NULL); - return; - } - /* Request to create a new bearer? */ if (create_bearer_str) { GError *error = NULL; @@ -1397,16 +1339,6 @@ mmcli_modem_run_synchronous (GDBusConnection *connection) return; } - /* Request to list the bearers? */ - if (list_bearers_flag) { - GList *result; - - g_debug ("Synchronously listing bearers..."); - result = mm_modem_list_bearers_sync (ctx->modem, NULL, &error); - list_bearers_process_reply (result, error); - return; - } - /* Request to create a new bearer? */ if (create_bearer_str) { MMBearer *bearer; |