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
|
||||
MMSimRemovability
|
||||
MMCellType
|
||||
MMServingCellType
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@@ -1924,4 +1924,29 @@ typedef enum { /*< underscore_name=mm_bearer_profile_source >*/
|
||||
MM_BEARER_PROFILE_SOURCE_DEVICE = 5,
|
||||
} 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_ */
|
||||
|
@@ -206,7 +206,7 @@
|
||||
GetCellInfo:
|
||||
|
||||
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
|
||||
one single cell.
|
||||
@@ -538,6 +538,21 @@
|
||||
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
||||
</listitem>
|
||||
</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>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -607,6 +622,21 @@
|
||||
Only applicable for the serving cell (i.e. "serving" must be TRUE).
|
||||
</listitem>
|
||||
</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>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -44,6 +44,8 @@ G_DEFINE_TYPE (MMCellInfoLte, mm_cell_info_lte, MM_TYPE_CELL_INFO)
|
||||
#define PROPERTY_RSRP "rsrp"
|
||||
#define PROPERTY_RSRQ "rsrq"
|
||||
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
||||
#define PROPERTY_SERVING_CELL_TYPE "serving-cell-type"
|
||||
#define PROPERTY_BANDWIDTH "bandwidth"
|
||||
|
||||
|
||||
struct _MMCellInfoLtePrivate {
|
||||
@@ -55,6 +57,8 @@ struct _MMCellInfoLtePrivate {
|
||||
gdouble rsrp;
|
||||
gdouble rsrq;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 *
|
||||
@@ -314,6 +374,8 @@ build_string (MMCellInfo *_self)
|
||||
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 ("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;
|
||||
}
|
||||
@@ -339,6 +401,8 @@ get_dictionary (MMCellInfo *_self)
|
||||
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 (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;
|
||||
}
|
||||
@@ -365,6 +429,8 @@ mm_cell_info_lte_new_from_dictionary (GVariantDict *dict)
|
||||
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, 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);
|
||||
@@ -380,6 +446,8 @@ mm_cell_info_lte_init (MMCellInfoLte *self)
|
||||
self->priv->rsrp = -G_MAXDOUBLE;
|
||||
self->priv->rsrq = -G_MAXDOUBLE;
|
||||
self->priv->timing_advance = G_MAXUINT;
|
||||
self->priv->serving_cell_type = MM_SERVING_CELL_TYPE_INVALID;
|
||||
self->priv->bandwidth = G_MAXUINT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -73,6 +73,8 @@ guint mm_cell_info_lte_get_earfcn (MMCellInfoLte *self);
|
||||
gdouble mm_cell_info_lte_get_rsrp (MMCellInfoLte *self);
|
||||
gdouble mm_cell_info_lte_get_rsrq (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 */
|
||||
@@ -97,6 +99,10 @@ void mm_cell_info_lte_set_rsrq (MMCellInfoLte *self,
|
||||
gdouble rsrq);
|
||||
void mm_cell_info_lte_set_timing_advance (MMCellInfoLte *self,
|
||||
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);
|
||||
|
||||
|
@@ -45,6 +45,8 @@ G_DEFINE_TYPE (MMCellInfoNr5g, mm_cell_info_nr5g, MM_TYPE_CELL_INFO)
|
||||
#define PROPERTY_RSRQ "rsrq"
|
||||
#define PROPERTY_SINR "sinr"
|
||||
#define PROPERTY_TIMING_ADVANCE "timing-advance"
|
||||
#define PROPERTY_SERVING_CELL_TYPE "serving-cell-type"
|
||||
#define PROPERTY_BANDWIDTH "bandwidth"
|
||||
|
||||
|
||||
struct _MMCellInfoNr5gPrivate {
|
||||
@@ -57,6 +59,8 @@ struct _MMCellInfoNr5gPrivate {
|
||||
gdouble rsrq;
|
||||
gdouble sinr;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 *
|
||||
@@ -345,6 +405,8 @@ build_string (MMCellInfo *_self)
|
||||
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 ("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;
|
||||
}
|
||||
@@ -371,6 +433,8 @@ get_dictionary (MMCellInfo *_self)
|
||||
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 (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;
|
||||
}
|
||||
@@ -398,6 +462,8 @@ mm_cell_info_nr5g_new_from_dictionary (GVariantDict *dict)
|
||||
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, 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);
|
||||
@@ -414,6 +480,8 @@ mm_cell_info_nr5g_init (MMCellInfoNr5g *self)
|
||||
self->priv->rsrq = -G_MAXDOUBLE;
|
||||
self->priv->sinr = -G_MAXDOUBLE;
|
||||
self->priv->timing_advance = G_MAXUINT;
|
||||
self->priv->serving_cell_type = MM_SERVING_CELL_TYPE_INVALID;
|
||||
self->priv->bandwidth = G_MAXUINT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -74,6 +74,8 @@ gdouble mm_cell_info_nr5g_get_rsrp (MMCellInfoNr5g *self);
|
||||
gdouble mm_cell_info_nr5g_get_rsrq (MMCellInfoNr5g *self);
|
||||
gdouble mm_cell_info_nr5g_get_sinr (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 */
|
||||
@@ -100,6 +102,10 @@ void mm_cell_info_nr5g_set_sinr (MMCellInfoNr5g *self,
|
||||
gdouble sinr);
|
||||
void mm_cell_info_nr5g_set_timing_advance (MMCellInfoNr5g *self,
|
||||
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);
|
||||
|
||||
|
Reference in New Issue
Block a user