diff --git a/cli/mmcli-modem-simple.c b/cli/mmcli-modem-simple.c index a8ef711d..22976a97 100644 --- a/cli/mmcli-modem-simple.c +++ b/cli/mmcli-modem-simple.c @@ -234,7 +234,7 @@ status_process_reply (MMSimpleStatus *result, signal_quality = (mm_simple_status_get_signal_quality ( result, &signal_quality_recent)); - mm_simple_status_get_bands (result, &bands, &n_bands); + mm_simple_status_get_current_bands (result, &bands, &n_bands); bands_str = mm_common_build_bands_string (bands, n_bands); access_tech_str = (mm_modem_access_technology_build_string_from_mask ( mm_simple_status_get_access_technologies (result))); diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 035645f3..e405307b 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -59,7 +59,7 @@ static gchar *create_bearer_str; static gchar *delete_bearer_str; static gchar *set_allowed_modes_str; static gchar *set_preferred_mode_str; -static gchar *set_bands_str; +static gchar *set_current_bands_str; static GOptionEntry entries[] = { { "monitor-state", 'w', 0, G_OPTION_ARG_NONE, &monitor_state_flag, @@ -110,14 +110,14 @@ static GOptionEntry entries[] = { "Set allowed modes in a given modem.", "[MODE1|MODE2...]" }, - { "set-bands", 0, 0, G_OPTION_ARG_STRING, &set_bands_str, - "Set bands to be used by a given modem.", - "[BAND1|BAND2...]" - }, { "set-preferred-mode", 0, 0, G_OPTION_ARG_STRING, &set_preferred_mode_str, "Set preferred mode in a given modem (Must give allowed modes with --set-allowed-modes)", "[MODE]" }, + { "set-current-bands", 0, 0, G_OPTION_ARG_STRING, &set_current_bands_str, + "Set bands to be used by a given modem.", + "[BAND1|BAND2...]" + }, { NULL } }; @@ -159,7 +159,7 @@ mmcli_modem_options_enabled (void) !!command_str + !!set_allowed_modes_str + !!set_preferred_mode_str + - !!set_bands_str); + !!set_current_bands_str); if (n_actions == 0 && mmcli_get_common_modem_string ()) { /* default to info */ @@ -242,13 +242,13 @@ print_modem_info (void) gchar *allowed_modes_string; gchar *preferred_mode_string; gchar *supported_bands_string; - gchar *bands_string; + gchar *current_bands_string; gchar *supported_ip_families_string; gchar *unlock_retries_string; gchar *own_numbers_string; MMModemBand *bands = NULL; - MMUnlockRetries *unlock_retries; guint n_bands = 0; + MMUnlockRetries *unlock_retries; guint signal_quality = 0; gboolean signal_quality_recent = FALSE; @@ -266,8 +266,8 @@ print_modem_info (void) mm_modem_get_current_capabilities (ctx->modem)); access_technologies_string = mm_modem_access_technology_build_string_from_mask ( mm_modem_get_access_technologies (ctx->modem)); - mm_modem_get_bands (ctx->modem, &bands, &n_bands); - bands_string = mm_common_build_bands_string (bands, n_bands); + mm_modem_get_current_bands (ctx->modem, &bands, &n_bands); + current_bands_string = mm_common_build_bands_string (bands, n_bands); g_free (bands); mm_modem_get_supported_bands (ctx->modem, &bands, &n_bands); supported_bands_string = mm_common_build_bands_string (bands, n_bands); @@ -384,7 +384,7 @@ print_modem_info (void) " Bands | supported: '%s'\n" " | current: '%s'\n", VALIDATE_UNKNOWN (supported_bands_string), - VALIDATE_UNKNOWN (bands_string)); + VALIDATE_UNKNOWN (current_bands_string)); /* IP families */ g_print (" -------------------------\n" @@ -459,7 +459,7 @@ print_modem_info (void) g_print ("\n"); g_free (supported_ip_families_string); - g_free (bands_string); + g_free (current_bands_string); g_free (supported_bands_string); g_free (access_technologies_string); g_free (modem_capabilities_string); @@ -801,39 +801,39 @@ parse_modes (MMModemMode *allowed, } static void -set_bands_process_reply (gboolean result, - const GError *error) +set_current_bands_process_reply (gboolean result, + const GError *error) { if (!result) { - g_printerr ("error: couldn't set bands: '%s'\n", + g_printerr ("error: couldn't set current bands: '%s'\n", error ? error->message : "unknown error"); exit (EXIT_FAILURE); } - g_print ("successfully set bands in the modem\n"); + g_print ("successfully set current bands in the modem\n"); } static void -set_bands_ready (MMModem *modem, - GAsyncResult *result, - gpointer nothing) +set_current_bands_ready (MMModem *modem, + GAsyncResult *result, + gpointer nothing) { gboolean operation_result; GError *error = NULL; - operation_result = mm_modem_set_bands_finish (modem, result, &error); - set_bands_process_reply (operation_result, error); + operation_result = mm_modem_set_current_bands_finish (modem, result, &error); + set_current_bands_process_reply (operation_result, error); mmcli_async_operation_done (); } static void -parse_bands (MMModemBand **bands, - guint *n_bands) +parse_current_bands (MMModemBand **bands, + guint *n_bands) { GError *error = NULL; - mm_common_get_bands_from_string (set_bands_str, + mm_common_get_bands_from_string (set_current_bands_str, bands, n_bands, &error); @@ -844,7 +844,6 @@ parse_bands (MMModemBand **bands, } } - static void state_changed (MMModem *modem, MMModemState old_state, @@ -1039,19 +1038,19 @@ get_modem_ready (GObject *source, return; } - /* Request to set allowed bands in a given modem? */ - if (set_bands_str) { - MMModemBand *bands; - guint n_bands; + /* Request to set current bands in a given modem? */ + if (set_current_bands_str) { + MMModemBand *current_bands; + guint n_current_bands; - parse_bands (&bands, &n_bands); - mm_modem_set_bands (ctx->modem, - bands, - n_bands, - ctx->cancellable, - (GAsyncReadyCallback)set_bands_ready, - NULL); - g_free (bands); + parse_current_bands (¤t_bands, &n_current_bands); + mm_modem_set_current_bands (ctx->modem, + current_bands, + n_current_bands, + ctx->cancellable, + (GAsyncReadyCallback)set_current_bands_ready, + NULL); + g_free (current_bands); return; } @@ -1254,19 +1253,19 @@ mmcli_modem_run_synchronous (GDBusConnection *connection) } /* Request to set allowed bands in a given modem? */ - if (set_bands_str) { + if (set_current_bands_str) { gboolean result; - MMModemBand *bands; - guint n_bands; + MMModemBand *current_bands; + guint n_current_bands; - parse_bands (&bands, &n_bands); - result = mm_modem_set_bands_sync (ctx->modem, - bands, - n_bands, - NULL, - &error); - g_free (bands); - set_bands_process_reply (result, error); + parse_current_bands (¤t_bands, &n_current_bands); + result = mm_modem_set_current_bands_sync (ctx->modem, + current_bands, + n_current_bands, + NULL, + &error); + g_free (current_bands); + set_current_bands_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 d65f1d00..358f613c 100644 --- a/docs/reference/libmm-glib/libmm-glib-sections.txt +++ b/docs/reference/libmm-glib/libmm-glib-sections.txt @@ -111,8 +111,8 @@ mm_modem_get_allowed_modes mm_modem_get_preferred_mode mm_modem_peek_supported_bands mm_modem_get_supported_bands -mm_modem_peek_bands -mm_modem_get_bands +mm_modem_peek_current_bands +mm_modem_get_current_bands mm_modem_get_supported_ip_families mm_modem_get_signal_quality mm_modem_get_access_technologies @@ -135,9 +135,9 @@ 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_bands -mm_modem_set_bands_finish -mm_modem_set_bands_sync +mm_modem_set_current_bands +mm_modem_set_current_bands_finish +mm_modem_set_current_bands_sync mm_modem_reset mm_modem_reset_finish mm_modem_reset_sync @@ -634,8 +634,8 @@ mm_simple_connect_properties_get_pin mm_simple_connect_properties_set_pin mm_simple_connect_properties_get_operator_id mm_simple_connect_properties_set_operator_id -mm_simple_connect_properties_get_bands -mm_simple_connect_properties_set_bands +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_apn @@ -677,7 +677,7 @@ MMSimpleStatus mm_simple_status_get_state mm_simple_status_get_signal_quality mm_simple_status_get_access_technologies -mm_simple_status_get_bands +mm_simple_status_get_current_bands mm_simple_status_get_3gpp_registration_state mm_simple_status_get_3gpp_operator_code mm_simple_status_get_3gpp_operator_name @@ -690,7 +690,7 @@ MM_SIMPLE_PROPERTY_3GPP_OPERATOR_CODE MM_SIMPLE_PROPERTY_3GPP_OPERATOR_NAME MM_SIMPLE_PROPERTY_3GPP_REGISTRATION_STATE MM_SIMPLE_PROPERTY_ACCESS_TECHNOLOGIES -MM_SIMPLE_PROPERTY_BANDS +MM_SIMPLE_PROPERTY_CURRENT_BANDS MM_SIMPLE_PROPERTY_CDMA_CDMA1X_REGISTRATION_STATE MM_SIMPLE_PROPERTY_CDMA_EVDO_REGISTRATION_STATE MM_SIMPLE_PROPERTY_CDMA_NID @@ -1417,8 +1417,8 @@ MmGdbusModemIface mm_gdbus_modem_get_access_technologies mm_gdbus_modem_get_allowed_modes -mm_gdbus_modem_get_bands -mm_gdbus_modem_dup_bands +mm_gdbus_modem_get_current_bands +mm_gdbus_modem_dup_current_bands mm_gdbus_modem_get_current_capabilities mm_gdbus_modem_get_device mm_gdbus_modem_dup_device @@ -1483,16 +1483,16 @@ 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_bands -mm_gdbus_modem_call_set_bands_finish -mm_gdbus_modem_call_set_bands_sync +mm_gdbus_modem_call_set_current_bands +mm_gdbus_modem_call_set_current_bands_finish +mm_gdbus_modem_call_set_current_bands_sync mm_gdbus_modem_call_command 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_bands +mm_gdbus_modem_set_current_bands mm_gdbus_modem_set_current_capabilities mm_gdbus_modem_set_device mm_gdbus_modem_set_device_identifier @@ -1528,7 +1528,7 @@ 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_bands +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.Simple.xml b/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml index 6e3d3163..ae50387f 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.Simple.xml @@ -52,7 +52,7 @@ given as a string value (signature "s"). - "bands" + "current-bands" List of MMModemBand values, to specify all the bands allowed in the modem, given as a list of @@ -165,7 +165,7 @@ (signature "u"). - "bands" + "current-bands" List of MMModemBand values, given only when registered, as a list of diff --git a/introspection/org.freedesktop.ModemManager1.Modem.xml b/introspection/org.freedesktop.ModemManager1.Modem.xml index 48b51514..0f8364b7 100644 --- a/introspection/org.freedesktop.ModemManager1.Modem.xml +++ b/introspection/org.freedesktop.ModemManager1.Modem.xml @@ -150,13 +150,13 @@ - + @@ -460,7 +460,7 @@ - +