diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 99233217..188fab8a 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -241,8 +241,10 @@ print_modem_info (void) MMModemModeCombination *modes = NULL; guint n_modes = 0; gchar *supported_modes_string; - gchar *allowed_modes_string; - gchar *preferred_mode_string; + MMModemMode allowed_modes; + gchar *allowed_modes_string = NULL; + MMModemMode preferred_mode; + gchar *preferred_mode_string = NULL; gchar *supported_bands_string; gchar *current_bands_string; gchar *supported_ip_families_string; @@ -277,10 +279,10 @@ print_modem_info (void) mm_modem_get_supported_bands (ctx->modem, &bands, &n_bands); supported_bands_string = mm_common_build_bands_string (bands, n_bands); g_free (bands); - allowed_modes_string = mm_modem_mode_build_string_from_mask ( - mm_modem_get_allowed_modes (ctx->modem)); - preferred_mode_string = mm_modem_mode_build_string_from_mask ( - mm_modem_get_preferred_mode (ctx->modem)); + if (mm_modem_get_current_modes (ctx->modem, &allowed_modes, &preferred_mode)) { + allowed_modes_string = mm_modem_mode_build_string_from_mask (allowed_modes); + preferred_mode_string = mm_modem_mode_build_string_from_mask (preferred_mode); + } supported_ip_families_string = mm_bearer_ip_family_build_string_from_mask ( mm_modem_get_supported_ip_families (ctx->modem)); @@ -385,8 +387,7 @@ print_modem_info (void) /* Modes */ g_print (" -------------------------\n" " Modes | supported: '%s'\n" - " | allowed: '%s'\n" - " | preferred: '%s'\n", + " | current: 'allowed: %s; preferred: %s'\n", VALIDATE_UNKNOWN (supported_modes_string), VALIDATE_UNKNOWN (allowed_modes_string), VALIDATE_UNKNOWN (preferred_mode_string)); @@ -763,28 +764,28 @@ delete_bearer_ready (MMModem *modem, } static void -set_allowed_modes_process_reply (gboolean result, +set_current_modes_process_reply (gboolean result, const GError *error) { if (!result) { - g_printerr ("error: couldn't set allowed modes: '%s'\n", + g_printerr ("error: couldn't set current modes: '%s'\n", error ? error->message : "unknown error"); exit (EXIT_FAILURE); } - g_print ("successfully set allowed modes in the modem\n"); + g_print ("successfully set current modes in the modem\n"); } static void -set_allowed_modes_ready (MMModem *modem, +set_current_modes_ready (MMModem *modem, GAsyncResult *result, gpointer nothing) { gboolean operation_result; GError *error = NULL; - operation_result = mm_modem_set_allowed_modes_finish (modem, result, &error); - set_allowed_modes_process_reply (operation_result, error); + operation_result = mm_modem_set_current_modes_finish (modem, result, &error); + set_current_modes_process_reply (operation_result, error); mmcli_async_operation_done (); } @@ -1041,11 +1042,11 @@ get_modem_ready (GObject *source, MMModemMode preferred; parse_modes (&allowed, &preferred); - mm_modem_set_allowed_modes (ctx->modem, + mm_modem_set_current_modes (ctx->modem, allowed, preferred, ctx->cancellable, - (GAsyncReadyCallback)set_allowed_modes_ready, + (GAsyncReadyCallback)set_current_modes_ready, NULL); return; } @@ -1254,13 +1255,13 @@ mmcli_modem_run_synchronous (GDBusConnection *connection) gboolean result; parse_modes (&allowed, &preferred); - result = mm_modem_set_allowed_modes_sync (ctx->modem, + result = mm_modem_set_current_modes_sync (ctx->modem, allowed, preferred, NULL, &error); - set_allowed_modes_process_reply (result, error); + set_current_modes_process_reply (result, error); return; } diff --git a/docs/reference/libmm-glib/libmm-glib-sections.txt b/docs/reference/libmm-glib/libmm-glib-sections.txt index 1d1704b4..830186f3 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -109,8 +109,7 @@ mm_modem_get_own_numbers mm_modem_dup_own_numbers mm_modem_peek_supported_modes mm_modem_get_supported_modes -mm_modem_get_allowed_modes -mm_modem_get_preferred_mode +mm_modem_get_current_modes mm_modem_peek_supported_bands mm_modem_get_supported_bands mm_modem_peek_current_bands @@ -134,9 +133,9 @@ mm_modem_disable_sync mm_modem_set_power_state mm_modem_set_power_state_finish mm_modem_set_power_state_sync -mm_modem_set_allowed_modes -mm_modem_set_allowed_modes_finish -mm_modem_set_allowed_modes_sync +mm_modem_set_current_modes +mm_modem_set_current_modes_finish +mm_modem_set_current_modes_sync mm_modem_set_current_bands mm_modem_set_current_bands_finish mm_modem_set_current_bands_sync @@ -638,8 +637,8 @@ mm_simple_connect_properties_get_operator_id mm_simple_connect_properties_set_operator_id mm_simple_connect_properties_get_current_bands mm_simple_connect_properties_set_current_bands -mm_simple_connect_properties_get_allowed_modes -mm_simple_connect_properties_set_allowed_modes +mm_simple_connect_properties_get_current_modes +mm_simple_connect_properties_set_current_modes mm_simple_connect_properties_get_apn mm_simple_connect_properties_set_apn mm_simple_connect_properties_get_allowed_auth @@ -1418,7 +1417,8 @@ MmGdbusModem MmGdbusModemIface mm_gdbus_modem_get_access_technologies -mm_gdbus_modem_get_allowed_modes +mm_gdbus_modem_get_current_modes +mm_gdbus_modem_dup_current_modes mm_gdbus_modem_get_current_bands mm_gdbus_modem_dup_current_bands mm_gdbus_modem_get_current_capabilities @@ -1444,7 +1444,6 @@ mm_gdbus_modem_dup_plugin mm_gdbus_modem_get_power_state mm_gdbus_modem_get_primary_port mm_gdbus_modem_dup_primary_port -mm_gdbus_modem_get_preferred_mode mm_gdbus_modem_get_revision mm_gdbus_modem_dup_revision mm_gdbus_modem_get_signal_quality @@ -1483,9 +1482,9 @@ mm_gdbus_modem_call_reset_sync mm_gdbus_modem_call_factory_reset mm_gdbus_modem_call_factory_reset_finish mm_gdbus_modem_call_factory_reset_sync -mm_gdbus_modem_call_set_allowed_modes -mm_gdbus_modem_call_set_allowed_modes_finish -mm_gdbus_modem_call_set_allowed_modes_sync +mm_gdbus_modem_call_set_current_modes +mm_gdbus_modem_call_set_current_modes_finish +mm_gdbus_modem_call_set_current_modes_sync mm_gdbus_modem_call_set_current_bands mm_gdbus_modem_call_set_current_bands_finish mm_gdbus_modem_call_set_current_bands_sync @@ -1494,7 +1493,7 @@ mm_gdbus_modem_call_command_finish mm_gdbus_modem_call_command_sync mm_gdbus_modem_set_access_technologies -mm_gdbus_modem_set_allowed_modes +mm_gdbus_modem_set_current_modes mm_gdbus_modem_set_current_bands mm_gdbus_modem_set_current_capabilities mm_gdbus_modem_set_device @@ -1509,7 +1508,6 @@ mm_gdbus_modem_set_modem_capabilities mm_gdbus_modem_set_own_numbers mm_gdbus_modem_set_plugin mm_gdbus_modem_set_primary_port -mm_gdbus_modem_set_preferred_mode mm_gdbus_modem_set_revision mm_gdbus_modem_set_signal_quality mm_gdbus_modem_set_sim @@ -1530,7 +1528,7 @@ mm_gdbus_modem_complete_set_power_state mm_gdbus_modem_complete_factory_reset mm_gdbus_modem_complete_list_bearers mm_gdbus_modem_complete_reset -mm_gdbus_modem_complete_set_allowed_modes +mm_gdbus_modem_complete_set_current_modes mm_gdbus_modem_complete_set_current_bands mm_gdbus_modem_interface_info mm_gdbus_modem_override_properties diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml b/introspection/org.freedesktop.ModemManager1.Modem.xml index 7b43846e..ba540ac8 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.xml @@ -137,16 +137,17 @@ - - - + + - - - - +