modem-cellinfo: adding bandwidth and serving cell type
adding bandwidth information in mm-dbus interface for the serving cell. In serving cell, the details on whether the pcell/scell are from MCS or SCG is also updated. Co-author: Shilpa Shivakumar
This commit is contained in:
@@ -64,6 +64,7 @@ MMSimType
|
|||||||
MMSimEsimStatus
|
MMSimEsimStatus
|
||||||
MMSimRemovability
|
MMSimRemovability
|
||||||
MMCellType
|
MMCellType
|
||||||
|
MMServingCellType
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
|
@@ -1924,4 +1924,29 @@ typedef enum { /*< underscore_name=mm_bearer_profile_source >*/
|
|||||||
MM_BEARER_PROFILE_SOURCE_DEVICE = 5,
|
MM_BEARER_PROFILE_SOURCE_DEVICE = 5,
|
||||||
} MMBearerProfileSource;
|
} MMBearerProfileSource;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* 'RF' enums */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MMServingCellType:
|
||||||
|
* @MM_SERVING_CELL_TYPE_UNKNOWN: Unknown.
|
||||||
|
* @MM_SERVING_CELL_TYPE_PCELL: In LTE CA, this refers to the primary cell. In ENDC case, this is the primary cell of MCS. In 5G SA, this refers to primary cell of NR.
|
||||||
|
* @MM_SERVING_CELL_TYPE_SCELL: In LTE CA, this refers to the secondary cell. In ENDC case, this is the secondary cell of MCS. In 5G SA, this refers to secondary cell of NR.
|
||||||
|
* @MM_SERVING_CELL_TYPE_PSCELL: Refers to primary cell of secondary cell group (SCG).
|
||||||
|
* @MM_SERVING_CELL_TYPE_SSCELL: Refers to secondary cell of secondary cell group (SCG).
|
||||||
|
* @MM_SERVING_CELL_TYPE_INVALID: Indicates that the radio is off, all other values are invalid.
|
||||||
|
*
|
||||||
|
* Indicates the frequency information provided belongs to which serving cell.
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
typedef enum { /*< underscore_name=mm_serving_cell_type >*/
|
||||||
|
MM_SERVING_CELL_TYPE_UNKNOWN = 0,
|
||||||
|
MM_SERVING_CELL_TYPE_PCELL = 1,
|
||||||
|
MM_SERVING_CELL_TYPE_SCELL = 2,
|
||||||
|
MM_SERVING_CELL_TYPE_PSCELL = 3,
|
||||||
|
MM_SERVING_CELL_TYPE_SSCELL = 4,
|
||||||
|
MM_SERVING_CELL_TYPE_INVALID = 0xFFFFFFFF
|
||||||
|
} MMServingCellType;
|
||||||
|
|
||||||
#endif /* _MODEMMANAGER_ENUMS_H_ */
|
#endif /* _MODEMMANAGER_ENUMS_H_ */
|
||||||
|
@@ -206,7 +206,7 @@
|
|||||||
GetCellInfo:
|
GetCellInfo:
|
||||||
|
|
||||||
Get information for available cells in different access technologies,
|
Get information for available cells in different access technologies,
|
||||||
either serving or neighboring.
|
either serving or neighboring along with radio frequency information.
|
||||||
|
|
||||||
An array of dictionaries is returned, where each dictionary reports information for
|
An array of dictionaries is returned, where each dictionary reports information for
|
||||||
one single cell.
|
one single cell.
|
||||||
@@ -538,6 +538,21 @@
|
|||||||
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry><term><literal>"serving-cell-type"</literal></term>
|
||||||
|
<listitem>
|
||||||
|
A <link linkend="MMServingCellType">MMServingCellType</link> value indicating that the frequency
|
||||||
|
information provided in this structure belongs to which servicing cell, given as an
|
||||||
|
unsigned integer (signature <literal>"u"</literal>).
|
||||||
|
Only applicable for the serving cell (i.e. "serving" must be TRUE). Since 1.22.
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry><term><literal>"bandwidth"</literal></term>
|
||||||
|
<listitem>
|
||||||
|
Bandwidth of the particular carrier in downlink, given as an unsigned integer
|
||||||
|
(signature <literal>"u"</literal>). Only applicable for the serving cell
|
||||||
|
(i.e. "serving" must be TRUE). Since 1.22.
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -607,6 +622,21 @@
|
|||||||
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry><term><literal>"serving-cell-type"</literal></term>
|
||||||
|
<listitem>
|
||||||
|
A <link linkend="MMServingCellType">MMServingCellType</link> value indicating that the frequency
|
||||||
|
information provided in this structure belongs to which servicing cell, given as an
|
||||||
|
unsigned integer (signature <literal>"u"</literal>).
|
||||||
|
Only applicable for the serving cell (i.e. "serving" must be TRUE). Since 1.22.
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry><term><literal>"bandwidth"</literal></term>
|
||||||
|
<listitem>
|
||||||
|
Bandwidth of the particular carrier in downlink, given as an unsigned integer
|
||||||
|
(signature <literal>"u"</literal>). Only applicable for the serving cell
|
||||||
|
(i.e. "serving" must be TRUE). Since 1.22.
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -36,14 +36,16 @@
|
|||||||
|
|
||||||
G_DEFINE_TYPE (MMCellInfoLte, mm_cell_info_lte, MM_TYPE_CELL_INFO)
|
G_DEFINE_TYPE (MMCellInfoLte, mm_cell_info_lte, MM_TYPE_CELL_INFO)
|
||||||
|
|
||||||
#define PROPERTY_OPERATOR_ID "operator-id"
|
#define PROPERTY_OPERATOR_ID "operator-id"
|
||||||
#define PROPERTY_TAC "tac"
|
#define PROPERTY_TAC "tac"
|
||||||
#define PROPERTY_CI "ci"
|
#define PROPERTY_CI "ci"
|
||||||
#define PROPERTY_PHYSICAL_CI "physical-ci"
|
#define PROPERTY_PHYSICAL_CI "physical-ci"
|
||||||
#define PROPERTY_EARFCN "earfcn"
|
#define PROPERTY_EARFCN "earfcn"
|
||||||
#define PROPERTY_RSRP "rsrp"
|
#define PROPERTY_RSRP "rsrp"
|
||||||
#define PROPERTY_RSRQ "rsrq"
|
#define PROPERTY_RSRQ "rsrq"
|
||||||
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
||||||
|
#define PROPERTY_SERVING_CELL_TYPE "serving-cell-type"
|
||||||
|
#define PROPERTY_BANDWIDTH "bandwidth"
|
||||||
|
|
||||||
|
|
||||||
struct _MMCellInfoLtePrivate {
|
struct _MMCellInfoLtePrivate {
|
||||||
@@ -55,6 +57,8 @@ struct _MMCellInfoLtePrivate {
|
|||||||
gdouble rsrp;
|
gdouble rsrp;
|
||||||
gdouble rsrq;
|
gdouble rsrq;
|
||||||
guint timing_advance;
|
guint timing_advance;
|
||||||
|
guint serving_cell_type;
|
||||||
|
guint bandwidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -296,6 +300,62 @@ mm_cell_info_lte_set_timing_advance (MMCellInfoLte *self,
|
|||||||
self->priv->timing_advance = timing_advance;
|
self->priv->timing_advance = timing_advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_lte_get_serving_cell_type:
|
||||||
|
* @self: a #MMCellInfoLte.
|
||||||
|
*
|
||||||
|
* Get the serving cell type.
|
||||||
|
*
|
||||||
|
* Returns: the serving cell type, or %MM_SERVING_CELL_TYPE_INVALID if not available.
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
MMServingCellType
|
||||||
|
mm_cell_info_lte_get_serving_cell_type (MMCellInfoLte *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CELL_INFO_LTE (self), MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
|
||||||
|
return self->priv->serving_cell_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_lte_set_serving_cell_type: (skip)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_cell_info_lte_set_serving_cell_type (MMCellInfoLte *self,
|
||||||
|
MMServingCellType cell_type)
|
||||||
|
{
|
||||||
|
self->priv->serving_cell_type = cell_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_lte_get_bandwidth:
|
||||||
|
* @self: a #MMCellInfoLte.
|
||||||
|
*
|
||||||
|
* Get the bandwidth of the particular carrier in downlink.
|
||||||
|
*
|
||||||
|
* Returns: the bandwidth, or %G_MAXUINT if not available.
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
mm_cell_info_lte_get_bandwidth (MMCellInfoLte *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CELL_INFO_LTE (self), G_MAXUINT);
|
||||||
|
|
||||||
|
return self->priv->bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_lte_set_bandwidth: (skip)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_cell_info_lte_set_bandwidth (MMCellInfoLte *self,
|
||||||
|
guint bandwidth)
|
||||||
|
{
|
||||||
|
self->priv->bandwidth = bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static GString *
|
static GString *
|
||||||
@@ -306,14 +366,16 @@ build_string (MMCellInfo *_self)
|
|||||||
|
|
||||||
str = g_string_new (NULL);
|
str = g_string_new (NULL);
|
||||||
|
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("operator id", "%s", operator_id, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("operator id", "%s", operator_id, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("tac", "%s", tac, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("tac", "%s", tac, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("ci", "%s", ci, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("ci", "%s", ci, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("physical ci", "%s", physical_ci, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("physical ci", "%s", physical_ci, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("earfcn", "%u", earfcn, G_MAXUINT);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("earfcn", "%u", earfcn, G_MAXUINT);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrp", "%lf", rsrp, -G_MAXDOUBLE);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrp", "%lf", rsrp, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrq", "%lf", rsrq, -G_MAXDOUBLE);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrq", "%lf", rsrq, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("timing advance", "%u", timing_advance, G_MAXUINT);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("timing advance", "%u", timing_advance, G_MAXUINT);
|
||||||
|
MM_CELL_INFO_BUILD_STRING_APPEND ("serving cell type", "%u", serving_cell_type, MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
MM_CELL_INFO_BUILD_STRING_APPEND ("bandwidth", "%u", bandwidth, G_MAXUINT);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -331,14 +393,16 @@ get_dictionary (MMCellInfo *_self)
|
|||||||
|
|
||||||
dict = g_variant_dict_new (NULL);
|
dict = g_variant_dict_new (NULL);
|
||||||
|
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (OPERATOR_ID, operator_id, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (OPERATOR_ID, operator_id, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (TAC, tac, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (TAC, tac, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (CI, ci, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (CI, ci, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (PHYSICAL_CI, physical_ci, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (PHYSICAL_CI, physical_ci, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (EARFCN, earfcn, uint32, G_MAXUINT);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (EARFCN, earfcn, uint32, G_MAXUINT);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRP, rsrp, double, -G_MAXDOUBLE);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRP, rsrp, double, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRQ, rsrq, double, -G_MAXDOUBLE);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRQ, rsrq, double, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (TIMING_ADVANCE, timing_advance, uint32, G_MAXUINT);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (TIMING_ADVANCE, timing_advance, uint32, G_MAXUINT);
|
||||||
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (SERVING_CELL_TYPE, serving_cell_type, uint32, MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (BANDWIDTH, bandwidth, uint32, G_MAXUINT);
|
||||||
|
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
@@ -361,10 +425,12 @@ mm_cell_info_lte_new_from_dictionary (GVariantDict *dict)
|
|||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (lte, CI, ci);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (lte, CI, ci);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (lte, PHYSICAL_CI, physical_ci);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (lte, PHYSICAL_CI, physical_ci);
|
||||||
|
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, EARFCN, earfcn, UINT32, uint32);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, EARFCN, earfcn, UINT32, uint32);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, RSRP, rsrp, DOUBLE, double);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, RSRP, rsrp, DOUBLE, double);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, RSRQ, rsrq, DOUBLE, double);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, RSRQ, rsrq, DOUBLE, double);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, TIMING_ADVANCE, timing_advance, UINT32, uint32);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, TIMING_ADVANCE, timing_advance, UINT32, uint32);
|
||||||
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, SERVING_CELL_TYPE, serving_cell_type, UINT32, uint32);
|
||||||
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (lte, BANDWIDTH, bandwidth, UINT32, uint32);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MM_CELL_INFO (self);
|
return MM_CELL_INFO (self);
|
||||||
@@ -376,10 +442,12 @@ static void
|
|||||||
mm_cell_info_lte_init (MMCellInfoLte *self)
|
mm_cell_info_lte_init (MMCellInfoLte *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_LTE, MMCellInfoLtePrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_LTE, MMCellInfoLtePrivate);
|
||||||
self->priv->earfcn = G_MAXUINT;
|
self->priv->earfcn = G_MAXUINT;
|
||||||
self->priv->rsrp = -G_MAXDOUBLE;
|
self->priv->rsrp = -G_MAXDOUBLE;
|
||||||
self->priv->rsrq = -G_MAXDOUBLE;
|
self->priv->rsrq = -G_MAXDOUBLE;
|
||||||
self->priv->timing_advance = G_MAXUINT;
|
self->priv->timing_advance = G_MAXUINT;
|
||||||
|
self->priv->serving_cell_type = MM_SERVING_CELL_TYPE_INVALID;
|
||||||
|
self->priv->bandwidth = G_MAXUINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -65,14 +65,16 @@ struct _MMCellInfoLteClass {
|
|||||||
GType mm_cell_info_lte_get_type (void);
|
GType mm_cell_info_lte_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCellInfoLte, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCellInfoLte, g_object_unref)
|
||||||
|
|
||||||
const gchar *mm_cell_info_lte_get_operator_id (MMCellInfoLte *self);
|
const gchar *mm_cell_info_lte_get_operator_id (MMCellInfoLte *self);
|
||||||
const gchar *mm_cell_info_lte_get_tac (MMCellInfoLte *self);
|
const gchar *mm_cell_info_lte_get_tac (MMCellInfoLte *self);
|
||||||
const gchar *mm_cell_info_lte_get_ci (MMCellInfoLte *self);
|
const gchar *mm_cell_info_lte_get_ci (MMCellInfoLte *self);
|
||||||
const gchar *mm_cell_info_lte_get_physical_ci (MMCellInfoLte *self);
|
const gchar *mm_cell_info_lte_get_physical_ci (MMCellInfoLte *self);
|
||||||
guint mm_cell_info_lte_get_earfcn (MMCellInfoLte *self);
|
guint mm_cell_info_lte_get_earfcn (MMCellInfoLte *self);
|
||||||
gdouble mm_cell_info_lte_get_rsrp (MMCellInfoLte *self);
|
gdouble mm_cell_info_lte_get_rsrp (MMCellInfoLte *self);
|
||||||
gdouble mm_cell_info_lte_get_rsrq (MMCellInfoLte *self);
|
gdouble mm_cell_info_lte_get_rsrq (MMCellInfoLte *self);
|
||||||
guint mm_cell_info_lte_get_timing_advance (MMCellInfoLte *self);
|
guint mm_cell_info_lte_get_timing_advance (MMCellInfoLte *self);
|
||||||
|
MMServingCellType mm_cell_info_lte_get_serving_cell_type (MMCellInfoLte *self);
|
||||||
|
guint mm_cell_info_lte_get_bandwidth (MMCellInfoLte *self);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ModemManager/libmm-glib/mmcli specific methods */
|
/* ModemManager/libmm-glib/mmcli specific methods */
|
||||||
@@ -81,22 +83,26 @@ guint mm_cell_info_lte_get_timing_advance (MMCellInfoLte *self);
|
|||||||
defined (_LIBMM_INSIDE_MMCLI) || \
|
defined (_LIBMM_INSIDE_MMCLI) || \
|
||||||
defined (LIBMM_GLIB_COMPILATION)
|
defined (LIBMM_GLIB_COMPILATION)
|
||||||
|
|
||||||
void mm_cell_info_lte_set_operator_id (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_operator_id (MMCellInfoLte *self,
|
||||||
const gchar *operator_id);
|
const gchar *operator_id);
|
||||||
void mm_cell_info_lte_set_tac (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_tac (MMCellInfoLte *self,
|
||||||
const gchar *tac);
|
const gchar *tac);
|
||||||
void mm_cell_info_lte_set_ci (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_ci (MMCellInfoLte *self,
|
||||||
const gchar *ci);
|
const gchar *ci);
|
||||||
void mm_cell_info_lte_set_physical_ci (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_physical_ci (MMCellInfoLte *self,
|
||||||
const gchar *ci);
|
const gchar *ci);
|
||||||
void mm_cell_info_lte_set_earfcn (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_earfcn (MMCellInfoLte *self,
|
||||||
guint earfcn);
|
guint earfcn);
|
||||||
void mm_cell_info_lte_set_rsrp (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_rsrp (MMCellInfoLte *self,
|
||||||
gdouble rsrp);
|
gdouble rsrp);
|
||||||
void mm_cell_info_lte_set_rsrq (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_rsrq (MMCellInfoLte *self,
|
||||||
gdouble rsrq);
|
gdouble rsrq);
|
||||||
void mm_cell_info_lte_set_timing_advance (MMCellInfoLte *self,
|
void mm_cell_info_lte_set_timing_advance (MMCellInfoLte *self,
|
||||||
guint earfcn);
|
guint earfcn);
|
||||||
|
void mm_cell_info_lte_set_serving_cell_type (MMCellInfoLte *self,
|
||||||
|
MMServingCellType cell_type);
|
||||||
|
void mm_cell_info_lte_set_bandwidth (MMCellInfoLte *self,
|
||||||
|
guint bandwidth);
|
||||||
|
|
||||||
MMCellInfo *mm_cell_info_lte_new_from_dictionary (GVariantDict *dict);
|
MMCellInfo *mm_cell_info_lte_new_from_dictionary (GVariantDict *dict);
|
||||||
|
|
||||||
|
@@ -36,15 +36,17 @@
|
|||||||
|
|
||||||
G_DEFINE_TYPE (MMCellInfoNr5g, mm_cell_info_nr5g, MM_TYPE_CELL_INFO)
|
G_DEFINE_TYPE (MMCellInfoNr5g, mm_cell_info_nr5g, MM_TYPE_CELL_INFO)
|
||||||
|
|
||||||
#define PROPERTY_OPERATOR_ID "operator-id"
|
#define PROPERTY_OPERATOR_ID "operator-id"
|
||||||
#define PROPERTY_TAC "tac"
|
#define PROPERTY_TAC "tac"
|
||||||
#define PROPERTY_CI "ci"
|
#define PROPERTY_CI "ci"
|
||||||
#define PROPERTY_PHYSICAL_CI "physical-ci"
|
#define PROPERTY_PHYSICAL_CI "physical-ci"
|
||||||
#define PROPERTY_NRARFCN "nrarfcn"
|
#define PROPERTY_NRARFCN "nrarfcn"
|
||||||
#define PROPERTY_RSRP "rsrp"
|
#define PROPERTY_RSRP "rsrp"
|
||||||
#define PROPERTY_RSRQ "rsrq"
|
#define PROPERTY_RSRQ "rsrq"
|
||||||
#define PROPERTY_SINR "sinr"
|
#define PROPERTY_SINR "sinr"
|
||||||
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
||||||
|
#define PROPERTY_SERVING_CELL_TYPE "serving-cell-type"
|
||||||
|
#define PROPERTY_BANDWIDTH "bandwidth"
|
||||||
|
|
||||||
|
|
||||||
struct _MMCellInfoNr5gPrivate {
|
struct _MMCellInfoNr5gPrivate {
|
||||||
@@ -57,6 +59,8 @@ struct _MMCellInfoNr5gPrivate {
|
|||||||
gdouble rsrq;
|
gdouble rsrq;
|
||||||
gdouble sinr;
|
gdouble sinr;
|
||||||
guint timing_advance;
|
guint timing_advance;
|
||||||
|
guint serving_cell_type;
|
||||||
|
guint bandwidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -326,6 +330,62 @@ mm_cell_info_nr5g_set_timing_advance (MMCellInfoNr5g *self,
|
|||||||
self->priv->timing_advance = timing_advance;
|
self->priv->timing_advance = timing_advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_nr5g_get_serving_cell_type:
|
||||||
|
* @self: a #MMCellInfoNr5g.
|
||||||
|
*
|
||||||
|
* Get the serving cell type.
|
||||||
|
*
|
||||||
|
* Returns: the serving cell type, or %MM_SERVING_CELL_TYPE_INVALID if not available.
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
MMServingCellType
|
||||||
|
mm_cell_info_nr5g_get_serving_cell_type (MMCellInfoNr5g *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CELL_INFO_NR5G (self), MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
|
||||||
|
return self->priv->serving_cell_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_nr5g_set_serving_cell_type: (skip)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_cell_info_nr5g_set_serving_cell_type (MMCellInfoNr5g *self,
|
||||||
|
MMServingCellType cell_type)
|
||||||
|
{
|
||||||
|
self->priv->serving_cell_type = cell_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_nr5g_get_bandwidth:
|
||||||
|
* @self: a #MMCellInfoNr5g.
|
||||||
|
*
|
||||||
|
* Get the bandwidth of the particular carrier in downlink.
|
||||||
|
*
|
||||||
|
* Returns: the bandwidth, or %G_MAXUINT if not available.
|
||||||
|
*
|
||||||
|
* Since: 1.22
|
||||||
|
*/
|
||||||
|
guint
|
||||||
|
mm_cell_info_nr5g_get_bandwidth (MMCellInfoNr5g *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_CELL_INFO_NR5G (self), G_MAXUINT);
|
||||||
|
|
||||||
|
return self->priv->bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_cell_info_nr5g_set_bandwidth: (skip)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_cell_info_nr5g_set_bandwidth (MMCellInfoNr5g *self,
|
||||||
|
guint bandwidth)
|
||||||
|
{
|
||||||
|
self->priv->bandwidth = bandwidth;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static GString *
|
static GString *
|
||||||
@@ -336,15 +396,17 @@ build_string (MMCellInfo *_self)
|
|||||||
|
|
||||||
str = g_string_new (NULL);
|
str = g_string_new (NULL);
|
||||||
|
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("operator id", "%s", operator_id, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("operator id", "%s", operator_id, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("tac", "%s", tac, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("tac", "%s", tac, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("ci", "%s", ci, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("ci", "%s", ci, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("physical ci", "%s", physical_ci, NULL);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("physical ci", "%s", physical_ci, NULL);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("nrarfcn", "%u", nrarfcn, G_MAXUINT);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("nrarfcn", "%u", nrarfcn, G_MAXUINT);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrp", "%lf", rsrp, -G_MAXDOUBLE);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrp", "%lf", rsrp, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrq", "%lf", rsrq, -G_MAXDOUBLE);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("rsrq", "%lf", rsrq, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("sinr", "%lf", sinr, -G_MAXDOUBLE);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("sinr", "%lf", sinr, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_BUILD_STRING_APPEND ("timing advance", "%u", timing_advance, G_MAXUINT);
|
MM_CELL_INFO_BUILD_STRING_APPEND ("timing advance", "%u", timing_advance, G_MAXUINT);
|
||||||
|
MM_CELL_INFO_BUILD_STRING_APPEND ("serving cell type", "%u", serving_cell_type, MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
MM_CELL_INFO_BUILD_STRING_APPEND ("bandwidth", "%u", bandwidth, G_MAXUINT);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -362,15 +424,17 @@ get_dictionary (MMCellInfo *_self)
|
|||||||
|
|
||||||
dict = g_variant_dict_new (NULL);
|
dict = g_variant_dict_new (NULL);
|
||||||
|
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (OPERATOR_ID, operator_id, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (OPERATOR_ID, operator_id, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (TAC, tac, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (TAC, tac, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (CI, ci, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (CI, ci, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (PHYSICAL_CI, physical_ci, string, NULL);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (PHYSICAL_CI, physical_ci, string, NULL);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (NRARFCN, nrarfcn, uint32, G_MAXUINT);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (NRARFCN, nrarfcn, uint32, G_MAXUINT);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRP, rsrp, double, -G_MAXDOUBLE);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRP, rsrp, double, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRQ, rsrq, double, -G_MAXDOUBLE);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (RSRQ, rsrq, double, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (SINR, sinr, double, -G_MAXDOUBLE);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (SINR, sinr, double, -G_MAXDOUBLE);
|
||||||
MM_CELL_INFO_GET_DICTIONARY_INSERT (TIMING_ADVANCE, timing_advance, uint32, G_MAXUINT);
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (TIMING_ADVANCE, timing_advance, uint32, G_MAXUINT);
|
||||||
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (SERVING_CELL_TYPE, serving_cell_type, uint32, MM_SERVING_CELL_TYPE_INVALID);
|
||||||
|
MM_CELL_INFO_GET_DICTIONARY_INSERT (BANDWIDTH, bandwidth, uint32, G_MAXUINT);
|
||||||
|
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
@@ -393,11 +457,13 @@ mm_cell_info_nr5g_new_from_dictionary (GVariantDict *dict)
|
|||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (nr5g, CI, ci);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (nr5g, CI, ci);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (nr5g, PHYSICAL_CI, physical_ci);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_STRING_SET (nr5g, PHYSICAL_CI, physical_ci);
|
||||||
|
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, NRARFCN, nrarfcn, UINT32, uint32);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, NRARFCN, nrarfcn, UINT32, uint32);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, RSRP, rsrp, DOUBLE, double);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, RSRP, rsrp, DOUBLE, double);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, RSRQ, rsrq, DOUBLE, double);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, RSRQ, rsrq, DOUBLE, double);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, SINR, sinr, DOUBLE, double);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, SINR, sinr, DOUBLE, double);
|
||||||
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, TIMING_ADVANCE, timing_advance, UINT32, uint32);
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, TIMING_ADVANCE, timing_advance, UINT32, uint32);
|
||||||
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, SERVING_CELL_TYPE, serving_cell_type, UINT32, uint32);
|
||||||
|
MM_CELL_INFO_NEW_FROM_DICTIONARY_NUM_SET (nr5g, BANDWIDTH, bandwidth, UINT32, uint32);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MM_CELL_INFO (self);
|
return MM_CELL_INFO (self);
|
||||||
@@ -409,11 +475,13 @@ static void
|
|||||||
mm_cell_info_nr5g_init (MMCellInfoNr5g *self)
|
mm_cell_info_nr5g_init (MMCellInfoNr5g *self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_NR5G, MMCellInfoNr5gPrivate);
|
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_NR5G, MMCellInfoNr5gPrivate);
|
||||||
self->priv->nrarfcn = G_MAXUINT;
|
self->priv->nrarfcn = G_MAXUINT;
|
||||||
self->priv->rsrp = -G_MAXDOUBLE;
|
self->priv->rsrp = -G_MAXDOUBLE;
|
||||||
self->priv->rsrq = -G_MAXDOUBLE;
|
self->priv->rsrq = -G_MAXDOUBLE;
|
||||||
self->priv->sinr = -G_MAXDOUBLE;
|
self->priv->sinr = -G_MAXDOUBLE;
|
||||||
self->priv->timing_advance = G_MAXUINT;
|
self->priv->timing_advance = G_MAXUINT;
|
||||||
|
self->priv->serving_cell_type = MM_SERVING_CELL_TYPE_INVALID;
|
||||||
|
self->priv->bandwidth = G_MAXUINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -65,15 +65,17 @@ struct _MMCellInfoNr5gClass {
|
|||||||
GType mm_cell_info_nr5g_get_type (void);
|
GType mm_cell_info_nr5g_get_type (void);
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCellInfoNr5g, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCellInfoNr5g, g_object_unref)
|
||||||
|
|
||||||
const gchar *mm_cell_info_nr5g_get_operator_id (MMCellInfoNr5g *self);
|
const gchar *mm_cell_info_nr5g_get_operator_id (MMCellInfoNr5g *self);
|
||||||
const gchar *mm_cell_info_nr5g_get_tac (MMCellInfoNr5g *self);
|
const gchar *mm_cell_info_nr5g_get_tac (MMCellInfoNr5g *self);
|
||||||
const gchar *mm_cell_info_nr5g_get_ci (MMCellInfoNr5g *self);
|
const gchar *mm_cell_info_nr5g_get_ci (MMCellInfoNr5g *self);
|
||||||
const gchar *mm_cell_info_nr5g_get_physical_ci (MMCellInfoNr5g *self);
|
const gchar *mm_cell_info_nr5g_get_physical_ci (MMCellInfoNr5g *self);
|
||||||
guint mm_cell_info_nr5g_get_nrarfcn (MMCellInfoNr5g *self);
|
guint mm_cell_info_nr5g_get_nrarfcn (MMCellInfoNr5g *self);
|
||||||
gdouble mm_cell_info_nr5g_get_rsrp (MMCellInfoNr5g *self);
|
gdouble mm_cell_info_nr5g_get_rsrp (MMCellInfoNr5g *self);
|
||||||
gdouble mm_cell_info_nr5g_get_rsrq (MMCellInfoNr5g *self);
|
gdouble mm_cell_info_nr5g_get_rsrq (MMCellInfoNr5g *self);
|
||||||
gdouble mm_cell_info_nr5g_get_sinr (MMCellInfoNr5g *self);
|
gdouble mm_cell_info_nr5g_get_sinr (MMCellInfoNr5g *self);
|
||||||
guint mm_cell_info_nr5g_get_timing_advance (MMCellInfoNr5g *self);
|
guint mm_cell_info_nr5g_get_timing_advance (MMCellInfoNr5g *self);
|
||||||
|
MMServingCellType mm_cell_info_nr5g_get_serving_cell_type (MMCellInfoNr5g *self);
|
||||||
|
guint mm_cell_info_nr5g_get_bandwidth (MMCellInfoNr5g *self);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ModemManager/libmm-glib/mmcli specific methods */
|
/* ModemManager/libmm-glib/mmcli specific methods */
|
||||||
@@ -82,24 +84,28 @@ guint mm_cell_info_nr5g_get_timing_advance (MMCellInfoNr5g *self);
|
|||||||
defined (_LIBMM_INSIDE_MMCLI) || \
|
defined (_LIBMM_INSIDE_MMCLI) || \
|
||||||
defined (LIBMM_GLIB_COMPILATION)
|
defined (LIBMM_GLIB_COMPILATION)
|
||||||
|
|
||||||
void mm_cell_info_nr5g_set_operator_id (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_operator_id (MMCellInfoNr5g *self,
|
||||||
const gchar *operator_id);
|
const gchar *operator_id);
|
||||||
void mm_cell_info_nr5g_set_tac (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_tac (MMCellInfoNr5g *self,
|
||||||
const gchar *tac);
|
const gchar *tac);
|
||||||
void mm_cell_info_nr5g_set_ci (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_ci (MMCellInfoNr5g *self,
|
||||||
const gchar *ci);
|
const gchar *ci);
|
||||||
void mm_cell_info_nr5g_set_physical_ci (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_physical_ci (MMCellInfoNr5g *self,
|
||||||
const gchar *ci);
|
const gchar *ci);
|
||||||
void mm_cell_info_nr5g_set_nrarfcn (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_nrarfcn (MMCellInfoNr5g *self,
|
||||||
guint earfcn);
|
guint earfcn);
|
||||||
void mm_cell_info_nr5g_set_rsrp (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_rsrp (MMCellInfoNr5g *self,
|
||||||
gdouble rsrp);
|
gdouble rsrp);
|
||||||
void mm_cell_info_nr5g_set_rsrq (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_rsrq (MMCellInfoNr5g *self,
|
||||||
gdouble rsrq);
|
gdouble rsrq);
|
||||||
void mm_cell_info_nr5g_set_sinr (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_sinr (MMCellInfoNr5g *self,
|
||||||
gdouble sinr);
|
gdouble sinr);
|
||||||
void mm_cell_info_nr5g_set_timing_advance (MMCellInfoNr5g *self,
|
void mm_cell_info_nr5g_set_timing_advance (MMCellInfoNr5g *self,
|
||||||
guint earfcn);
|
guint earfcn);
|
||||||
|
void mm_cell_info_nr5g_set_serving_cell_type (MMCellInfoNr5g *self,
|
||||||
|
MMServingCellType cell_type);
|
||||||
|
void mm_cell_info_nr5g_set_bandwidth (MMCellInfoNr5g *self,
|
||||||
|
guint bandwidth);
|
||||||
|
|
||||||
MMCellInfo *mm_cell_info_nr5g_new_from_dictionary (GVariantDict *dict);
|
MMCellInfo *mm_cell_info_nr5g_new_from_dictionary (GVariantDict *dict);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user