modem-manager: read 'SupportedCapabilities' instead of 'ModemCapabilities' (bgo #701668)

There is no longer a 'ModemCapabilities' uint32 property; instead we have
'SupportedCapabilities' giving a list of uint32 values. Just read the list and
merge the values into a single mask; NM doesn't care about the exact
combinations supported.

https://bugzilla.gnome.org/show_bug.cgi?id=701668
This commit is contained in:
Aleksander Morgado 2013-06-05 16:34:10 +02:00 committed by Dan Williams
parent b0863cbc4d
commit c3706810ef
2 changed files with 17 additions and 4 deletions

View file

@ -463,7 +463,7 @@ AC_SUBST(PPPD_PLUGIN_DIR)
AC_ARG_WITH(modem-manager-1, AS_HELP_STRING([--with-modem-manager-1], [Enable new ModemManager1 interface support]),,[with_modem_manager_1=auto])
if (test "${with_modem_manager_1}" != "no"); then
PKG_CHECK_MODULES(MM_GLIB,
[mm-glib],
[mm-glib >= 0.7.991],
[have_libmm_glib=yes],
[have_libmm_glib=no])
AC_SUBST(MM_GLIB_CFLAGS)
@ -775,4 +775,3 @@ echo " tests: $enable_tests"
echo " valgrind: $with_valgrind"
echo " code coverage: $enable_code_coverage"
echo

View file

@ -106,9 +106,23 @@ get_capabilities (NMModem *_self,
NMDeviceModemCapabilities *current_caps)
{
NMModemBroadband *self = NM_MODEM_BROADBAND (_self);
MMModemCapability all_supported = MM_MODEM_CAPABILITY_NONE;
MMModemCapability *supported;
guint n_supported;
*modem_caps = (NMDeviceModemCapabilities)mm_modem_get_modem_capabilities (self->priv->modem_iface);
*current_caps = (NMDeviceModemCapabilities)mm_modem_get_current_capabilities (self->priv->modem_iface);
/* For now, we don't care about the capability combinations, just merge all
* combinations in a single mask */
if (mm_modem_get_supported_capabilities (self->priv->modem_iface, &supported, &n_supported)) {
guint i;
for (i = 0; i < n_supported; i++)
all_supported |= supported[i];
g_free (supported);
}
*modem_caps = (NMDeviceModemCapabilities) all_supported;
*current_caps = (NMDeviceModemCapabilities) mm_modem_get_current_capabilities (self->priv->modem_iface);
}
/*****************************************************************************/