iface-modem: new helpers to check if modem has LTE capabilities
This commit is contained in:
@@ -2850,6 +2850,18 @@ mm_iface_modem_is_3gpp (MMIfaceModem *self)
|
|||||||
return (capabilities & MM_MODEM_CAPABILITY_3GPP);
|
return (capabilities & MM_MODEM_CAPABILITY_3GPP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_iface_modem_is_3gpp_lte (MMIfaceModem *self)
|
||||||
|
{
|
||||||
|
MMModemCapability capabilities = MM_MODEM_CAPABILITY_NONE;
|
||||||
|
|
||||||
|
g_object_get (self,
|
||||||
|
MM_IFACE_MODEM_CURRENT_CAPABILITIES, &capabilities,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return (capabilities & MM_MODEM_CAPABILITY_3GPP_LTE);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_iface_modem_is_cdma (MMIfaceModem *self)
|
mm_iface_modem_is_cdma (MMIfaceModem *self)
|
||||||
{
|
{
|
||||||
@@ -2862,18 +2874,6 @@ mm_iface_modem_is_cdma (MMIfaceModem *self)
|
|||||||
return (capabilities & MM_MODEM_CAPABILITY_CDMA_EVDO);
|
return (capabilities & MM_MODEM_CAPABILITY_CDMA_EVDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
mm_iface_modem_is_cdma_only (MMIfaceModem *self)
|
|
||||||
{
|
|
||||||
MMModemCapability capabilities = MM_MODEM_CAPABILITY_NONE;
|
|
||||||
|
|
||||||
g_object_get (self,
|
|
||||||
MM_IFACE_MODEM_CURRENT_CAPABILITIES, &capabilities,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return (capabilities == MM_MODEM_CAPABILITY_CDMA_EVDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_iface_modem_is_3gpp_only (MMIfaceModem *self)
|
mm_iface_modem_is_3gpp_only (MMIfaceModem *self)
|
||||||
{
|
{
|
||||||
@@ -2886,6 +2886,30 @@ mm_iface_modem_is_3gpp_only (MMIfaceModem *self)
|
|||||||
return ((MM_MODEM_CAPABILITY_3GPP ^ capabilities) & capabilities);
|
return ((MM_MODEM_CAPABILITY_3GPP ^ capabilities) & capabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_iface_modem_is_3gpp_lte_only (MMIfaceModem *self)
|
||||||
|
{
|
||||||
|
MMModemCapability capabilities = MM_MODEM_CAPABILITY_NONE;
|
||||||
|
|
||||||
|
g_object_get (self,
|
||||||
|
MM_IFACE_MODEM_CURRENT_CAPABILITIES, &capabilities,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return ((MM_MODEM_CAPABILITY_3GPP_LTE ^ capabilities) & capabilities);
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_iface_modem_is_cdma_only (MMIfaceModem *self)
|
||||||
|
{
|
||||||
|
MMModemCapability capabilities = MM_MODEM_CAPABILITY_NONE;
|
||||||
|
|
||||||
|
g_object_get (self,
|
||||||
|
MM_IFACE_MODEM_CURRENT_CAPABILITIES, &capabilities,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
return (capabilities == MM_MODEM_CAPABILITY_CDMA_EVDO);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -253,6 +253,8 @@ GType mm_iface_modem_get_type (void);
|
|||||||
/* Check whether this modem has 3GPP capabilities */
|
/* Check whether this modem has 3GPP capabilities */
|
||||||
gboolean mm_iface_modem_is_3gpp (MMIfaceModem *self);
|
gboolean mm_iface_modem_is_3gpp (MMIfaceModem *self);
|
||||||
gboolean mm_iface_modem_is_3gpp_only (MMIfaceModem *self);
|
gboolean mm_iface_modem_is_3gpp_only (MMIfaceModem *self);
|
||||||
|
gboolean mm_iface_modem_is_3gpp_lte (MMIfaceModem *self);
|
||||||
|
gboolean mm_iface_modem_is_3gpp_lte_only (MMIfaceModem *self);
|
||||||
|
|
||||||
/* Check whether this modem has CDMA capabilities */
|
/* Check whether this modem has CDMA capabilities */
|
||||||
gboolean mm_iface_modem_is_cdma (MMIfaceModem *self);
|
gboolean mm_iface_modem_is_cdma (MMIfaceModem *self);
|
||||||
|
@@ -22,11 +22,13 @@
|
|||||||
#include "mm-modem-cdma.h"
|
#include "mm-modem-cdma.h"
|
||||||
#include "mm-charsets.h"
|
#include "mm-charsets.h"
|
||||||
|
|
||||||
#define MM_MODEM_CAPABILITY_3GPP \
|
#define MM_MODEM_CAPABILITY_3GPP_LTE \
|
||||||
(MM_MODEM_CAPABILITY_GSM_UMTS | \
|
(MM_MODEM_CAPABILITY_LTE | \
|
||||||
MM_MODEM_CAPABILITY_LTE | \
|
|
||||||
MM_MODEM_CAPABILITY_LTE_ADVANCED)
|
MM_MODEM_CAPABILITY_LTE_ADVANCED)
|
||||||
|
|
||||||
|
#define MM_MODEM_CAPABILITY_3GPP \
|
||||||
|
(MM_MODEM_CAPABILITY_GSM_UMTS | \
|
||||||
|
MM_MODEM_CAPABILITY_3GPP_LTE)
|
||||||
|
|
||||||
/* Network scan results expected */
|
/* Network scan results expected */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Reference in New Issue
Block a user