diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-05-24 12:35:44 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-05 19:15:15 +0200 |
commit | 700ebc5c07ce667204f95dbe61716234131c15fb (patch) | |
tree | b31f281dbcd072cbb360847f858e0eda5af67a8f /src/mm-modem-helpers.c | |
parent | 1c67d050cb0451a63c8fdb0bd673892bdc04e4e0 (diff) |
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'
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 6d0acb20..cd4ef763 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -295,6 +295,34 @@ mm_filter_supported_modes (const GArray *all, /*****************************************************************************/ +GArray * +mm_filter_supported_capabilities (MMModemCapability all, + const GArray *supported_combinations) +{ + guint i; + GArray *filtered_combinations; + + g_return_val_if_fail (all != MM_MODEM_CAPABILITY_NONE, NULL); + g_return_val_if_fail (supported_combinations != NULL, NULL); + + /* We will filter out all combinations which have modes not listed in 'all' */ + filtered_combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemCapability), supported_combinations->len); + for (i = 0; i < supported_combinations->len; i++) { + MMModemCapability capability; + + capability = g_array_index (supported_combinations, MMModemCapability, i); + if (!(capability & ~all)) + g_array_append_val (filtered_combinations, capability); + } + + if (filtered_combinations->len == 0) + mm_warn ("All supported capability combinations were filtered out."); + + return filtered_combinations; +} + +/*****************************************************************************/ + /* +CREG: <stat> (GSM 07.07 CREG=1 unsolicited) */ #define CREG1 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9])" |