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:
som
2022-11-02 11:34:23 +05:30
committed by Aleksander Morgado
parent fe7008e414
commit e8d63c1743
7 changed files with 325 additions and 121 deletions

View File

@@ -64,6 +64,7 @@ MMSimType
MMSimEsimStatus
MMSimRemovability
MMCellType
MMServingCellType
</SECTION>
<SECTION>

View File

@@ -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_ */

View File

@@ -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>

View File

@@ -36,14 +36,16 @@
G_DEFINE_TYPE (MMCellInfoLte, mm_cell_info_lte, MM_TYPE_CELL_INFO)
#define PROPERTY_OPERATOR_ID "operator-id"
#define PROPERTY_TAC "tac"
#define PROPERTY_CI "ci"
#define PROPERTY_PHYSICAL_CI "physical-ci"
#define PROPERTY_EARFCN "earfcn"
#define PROPERTY_RSRP "rsrp"
#define PROPERTY_RSRQ "rsrq"
#define PROPERTY_TIMING_ADVANCE "timing-advance"
#define PROPERTY_OPERATOR_ID "operator-id"
#define PROPERTY_TAC "tac"
#define PROPERTY_CI "ci"
#define PROPERTY_PHYSICAL_CI "physical-ci"
#define PROPERTY_EARFCN "earfcn"
#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 *
@@ -306,14 +366,16 @@ build_string (MMCellInfo *_self)
str = g_string_new (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 ("ci", "%s", 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 ("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 ("operator id", "%s", operator_id, 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 ("physical ci", "%s", physical_ci, NULL);
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 ("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;
}
@@ -331,14 +393,16 @@ get_dictionary (MMCellInfo *_self)
dict = g_variant_dict_new (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 (CI, 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 (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 (OPERATOR_ID, operator_id, 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 (PHYSICAL_CI, physical_ci, string, NULL);
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 (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;
}
@@ -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, 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, 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, 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, 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);
@@ -376,10 +442,12 @@ static void
mm_cell_info_lte_init (MMCellInfoLte *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_LTE, MMCellInfoLtePrivate);
self->priv->earfcn = G_MAXUINT;
self->priv->rsrp = -G_MAXDOUBLE;
self->priv->rsrq = -G_MAXDOUBLE;
self->priv->timing_advance = G_MAXUINT;
self->priv->earfcn = G_MAXUINT;
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

View File

@@ -65,14 +65,16 @@ struct _MMCellInfoLteClass {
GType mm_cell_info_lte_get_type (void);
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_tac (MMCellInfoLte *self);
const gchar *mm_cell_info_lte_get_ci (MMCellInfoLte *self);
const gchar *mm_cell_info_lte_get_physical_ci (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_rsrq (MMCellInfoLte *self);
guint mm_cell_info_lte_get_timing_advance (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_ci (MMCellInfoLte *self);
const gchar *mm_cell_info_lte_get_physical_ci (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_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 */
@@ -81,22 +83,26 @@ guint mm_cell_info_lte_get_timing_advance (MMCellInfoLte *self);
defined (_LIBMM_INSIDE_MMCLI) || \
defined (LIBMM_GLIB_COMPILATION)
void mm_cell_info_lte_set_operator_id (MMCellInfoLte *self,
const gchar *operator_id);
void mm_cell_info_lte_set_tac (MMCellInfoLte *self,
const gchar *tac);
void mm_cell_info_lte_set_ci (MMCellInfoLte *self,
const gchar *ci);
void mm_cell_info_lte_set_physical_ci (MMCellInfoLte *self,
const gchar *ci);
void mm_cell_info_lte_set_earfcn (MMCellInfoLte *self,
guint earfcn);
void mm_cell_info_lte_set_rsrp (MMCellInfoLte *self,
gdouble rsrp);
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_operator_id (MMCellInfoLte *self,
const gchar *operator_id);
void mm_cell_info_lte_set_tac (MMCellInfoLte *self,
const gchar *tac);
void mm_cell_info_lte_set_ci (MMCellInfoLte *self,
const gchar *ci);
void mm_cell_info_lte_set_physical_ci (MMCellInfoLte *self,
const gchar *ci);
void mm_cell_info_lte_set_earfcn (MMCellInfoLte *self,
guint earfcn);
void mm_cell_info_lte_set_rsrp (MMCellInfoLte *self,
gdouble rsrp);
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);

View File

@@ -36,15 +36,17 @@
G_DEFINE_TYPE (MMCellInfoNr5g, mm_cell_info_nr5g, MM_TYPE_CELL_INFO)
#define PROPERTY_OPERATOR_ID "operator-id"
#define PROPERTY_TAC "tac"
#define PROPERTY_CI "ci"
#define PROPERTY_PHYSICAL_CI "physical-ci"
#define PROPERTY_NRARFCN "nrarfcn"
#define PROPERTY_RSRP "rsrp"
#define PROPERTY_RSRQ "rsrq"
#define PROPERTY_SINR "sinr"
#define PROPERTY_TIMING_ADVANCE "timing-advance"
#define PROPERTY_OPERATOR_ID "operator-id"
#define PROPERTY_TAC "tac"
#define PROPERTY_CI "ci"
#define PROPERTY_PHYSICAL_CI "physical-ci"
#define PROPERTY_NRARFCN "nrarfcn"
#define PROPERTY_RSRP "rsrp"
#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 *
@@ -336,15 +396,17 @@ build_string (MMCellInfo *_self)
str = g_string_new (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 ("ci", "%s", 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 ("rsrp", "%lf", rsrp, -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 ("timing advance", "%u", timing_advance, G_MAXUINT);
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 ("ci", "%s", 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 ("rsrp", "%lf", rsrp, -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 ("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;
}
@@ -362,15 +424,17 @@ get_dictionary (MMCellInfo *_self)
dict = g_variant_dict_new (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 (CI, 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 (RSRP, rsrp, 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 (TIMING_ADVANCE, timing_advance, uint32, G_MAXUINT);
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 (CI, 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 (RSRP, rsrp, 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 (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;
}
@@ -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, 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, 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, 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, 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, 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);
@@ -409,11 +475,13 @@ static void
mm_cell_info_nr5g_init (MMCellInfoNr5g *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MM_TYPE_CELL_INFO_NR5G, MMCellInfoNr5gPrivate);
self->priv->nrarfcn = G_MAXUINT;
self->priv->rsrp = -G_MAXDOUBLE;
self->priv->rsrq = -G_MAXDOUBLE;
self->priv->sinr = -G_MAXDOUBLE;
self->priv->timing_advance = G_MAXUINT;
self->priv->nrarfcn = G_MAXUINT;
self->priv->rsrp = -G_MAXDOUBLE;
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

View File

@@ -65,15 +65,17 @@ struct _MMCellInfoNr5gClass {
GType mm_cell_info_nr5g_get_type (void);
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_tac (MMCellInfoNr5g *self);
const gchar *mm_cell_info_nr5g_get_ci (MMCellInfoNr5g *self);
const gchar *mm_cell_info_nr5g_get_physical_ci (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_rsrq (MMCellInfoNr5g *self);
gdouble mm_cell_info_nr5g_get_sinr (MMCellInfoNr5g *self);
guint mm_cell_info_nr5g_get_timing_advance (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_ci (MMCellInfoNr5g *self);
const gchar *mm_cell_info_nr5g_get_physical_ci (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_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 */
@@ -82,24 +84,28 @@ guint mm_cell_info_nr5g_get_timing_advance (MMCellInfoNr5g *self);
defined (_LIBMM_INSIDE_MMCLI) || \
defined (LIBMM_GLIB_COMPILATION)
void mm_cell_info_nr5g_set_operator_id (MMCellInfoNr5g *self,
const gchar *operator_id);
void mm_cell_info_nr5g_set_tac (MMCellInfoNr5g *self,
const gchar *tac);
void mm_cell_info_nr5g_set_ci (MMCellInfoNr5g *self,
const gchar *ci);
void mm_cell_info_nr5g_set_physical_ci (MMCellInfoNr5g *self,
const gchar *ci);
void mm_cell_info_nr5g_set_nrarfcn (MMCellInfoNr5g *self,
guint earfcn);
void mm_cell_info_nr5g_set_rsrp (MMCellInfoNr5g *self,
gdouble rsrp);
void mm_cell_info_nr5g_set_rsrq (MMCellInfoNr5g *self,
gdouble rsrq);
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_operator_id (MMCellInfoNr5g *self,
const gchar *operator_id);
void mm_cell_info_nr5g_set_tac (MMCellInfoNr5g *self,
const gchar *tac);
void mm_cell_info_nr5g_set_ci (MMCellInfoNr5g *self,
const gchar *ci);
void mm_cell_info_nr5g_set_physical_ci (MMCellInfoNr5g *self,
const gchar *ci);
void mm_cell_info_nr5g_set_nrarfcn (MMCellInfoNr5g *self,
guint earfcn);
void mm_cell_info_nr5g_set_rsrp (MMCellInfoNr5g *self,
gdouble rsrp);
void mm_cell_info_nr5g_set_rsrq (MMCellInfoNr5g *self,
gdouble rsrq);
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);