api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'

And also make it a list of masks, specifying which are the specific combinations
supported, not just one mask with all.

E.g.:
  -------------------------
  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
           |          model: 'MC7710'
           |       revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14'
           |      supported: 'gsm-umts
           |                  gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '358178040668164'
This commit is contained in:
Aleksander Morgado
2013-06-05 19:15:15 +02:00
parent 1c67d050cb
commit 700ebc5c07
15 changed files with 546 additions and 95 deletions
+18 -6
View File
@@ -235,7 +235,9 @@ print_modem_info (void)
{
gchar *drivers_string;
gchar *prefixed_revision;
gchar *modem_capabilities_string;
gchar *supported_capabilities_string;
MMModemCapability *capabilities = NULL;
guint n_capabilities = 0;
gchar *current_capabilities_string;
gchar *access_technologies_string;
MMModemModeCombination *modes = NULL;
@@ -264,8 +266,9 @@ print_modem_info (void)
#define VALIDATE_PATH(str) ((str && !g_str_equal (str, "/")) ? str : "none")
/* Strings in heap */
modem_capabilities_string = mm_modem_capability_build_string_from_mask (
mm_modem_get_modem_capabilities (ctx->modem));
mm_modem_get_supported_capabilities (ctx->modem, &capabilities, &n_capabilities);
supported_capabilities_string = mm_common_build_capabilities_string (capabilities, n_capabilities);
g_free (capabilities);
current_capabilities_string = mm_modem_capability_build_string_from_mask (
mm_modem_get_current_capabilities (ctx->modem));
access_technologies_string = mm_modem_access_technology_build_string_from_mask (
@@ -324,6 +327,15 @@ print_modem_info (void)
supported_modes_string = prefixed;
}
if (supported_capabilities_string) {
gchar *prefixed;
prefixed = mmcli_prefix_newlines (" | ",
supported_capabilities_string);
g_free (supported_capabilities_string);
supported_capabilities_string = prefixed;
}
/* Get signal quality info */
signal_quality = mm_modem_get_signal_quality (ctx->modem, &signal_quality_recent);
@@ -338,13 +350,13 @@ print_modem_info (void)
" Hardware | manufacturer: '%s'\n"
" | model: '%s'\n"
" | revision: '%s'\n"
" | capabilities: '%s'\n"
" | supported: '%s'\n"
" | current: '%s'\n"
" | equipment id: '%s'\n",
VALIDATE_UNKNOWN (mm_modem_get_manufacturer (ctx->modem)),
VALIDATE_UNKNOWN (mm_modem_get_model (ctx->modem)),
VALIDATE_UNKNOWN (prefixed_revision),
VALIDATE_UNKNOWN (modem_capabilities_string),
VALIDATE_UNKNOWN (supported_capabilities_string),
VALIDATE_UNKNOWN (current_capabilities_string),
VALIDATE_UNKNOWN (mm_modem_get_equipment_identifier (ctx->modem)));
@@ -475,7 +487,7 @@ print_modem_info (void)
g_free (current_bands_string);
g_free (supported_bands_string);
g_free (access_technologies_string);
g_free (modem_capabilities_string);
g_free (supported_capabilities_string);
g_free (current_capabilities_string);
g_free (prefixed_revision);
g_free (allowed_modes_string);