diff --git a/src/core/devices/wwan/nm-modem-broadband.c b/src/core/devices/wwan/nm-modem-broadband.c index 775afa64e..81f090c61 100644 --- a/src/core/devices/wwan/nm-modem-broadband.c +++ b/src/core/devices/wwan/nm-modem-broadband.c @@ -204,6 +204,13 @@ get_capabilities(NMModem *_self, MMModemCapability *supported; guint n_supported; + G_STATIC_ASSERT(MM_MODEM_CAPABILITY_POTS == (guint64) NM_DEVICE_MODEM_CAPABILITY_POTS); + G_STATIC_ASSERT(MM_MODEM_CAPABILITY_CDMA_EVDO + == (guint64) NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO); + G_STATIC_ASSERT(MM_MODEM_CAPABILITY_GSM_UMTS == (guint64) NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS); + G_STATIC_ASSERT(MM_MODEM_CAPABILITY_LTE == (guint64) NM_DEVICE_MODEM_CAPABILITY_LTE); + G_STATIC_ASSERT(MM_MODEM_CAPABILITY_5GNR == (guint64) NM_DEVICE_MODEM_CAPABILITY_5GNR); + /* 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)) { diff --git a/src/libnm-core-public/nm-dbus-interface.h b/src/libnm-core-public/nm-dbus-interface.h index d67637327..fe2a6c09d 100644 --- a/src/libnm-core-public/nm-dbus-interface.h +++ b/src/libnm-core-public/nm-dbus-interface.h @@ -443,6 +443,8 @@ typedef enum { /*< flags >*/ NM_DEVICE_MODEM_CAPABILITY_LTE = 0x00000008, NM_DEVICE_MODEM_CAPABILITY_5GNR = 0x00000040, } NMDeviceModemCapabilities; +/* Note: the numeric values of NMDeviceModemCapabilities must be identical to the values + * in MMModemCapability. See the G_STATIC_ASSERT() in nm-modem-broadband.c's get_capabilities(). */ /** * NMWimaxNspNetworkType: