libmm-glib,mmcli: add support for 'error-rate' measurements in signal info
Includes updates by Aleksander Morgado to fix mostly coding style issues.
This commit is contained in:

committed by
Aleksander Morgado

parent
296b5185f5
commit
9537261651
@@ -141,21 +141,27 @@ print_signal_info (void)
|
|||||||
gchar *refresh_rate;
|
gchar *refresh_rate;
|
||||||
gchar *cdma1x_rssi = NULL;
|
gchar *cdma1x_rssi = NULL;
|
||||||
gchar *cdma1x_ecio = NULL;
|
gchar *cdma1x_ecio = NULL;
|
||||||
|
gchar *cdma1x_error_rate = NULL;
|
||||||
gchar *evdo_rssi = NULL;
|
gchar *evdo_rssi = NULL;
|
||||||
gchar *evdo_ecio = NULL;
|
gchar *evdo_ecio = NULL;
|
||||||
gchar *evdo_sinr = NULL;
|
gchar *evdo_sinr = NULL;
|
||||||
gchar *evdo_io = NULL;
|
gchar *evdo_io = NULL;
|
||||||
|
gchar *evdo_error_rate = NULL;
|
||||||
gchar *gsm_rssi = NULL;
|
gchar *gsm_rssi = NULL;
|
||||||
|
gchar *gsm_error_rate = NULL;
|
||||||
gchar *umts_rssi = NULL;
|
gchar *umts_rssi = NULL;
|
||||||
gchar *umts_rscp = NULL;
|
gchar *umts_rscp = NULL;
|
||||||
gchar *umts_ecio = NULL;
|
gchar *umts_ecio = NULL;
|
||||||
|
gchar *umts_error_rate = NULL;
|
||||||
gchar *lte_rssi = NULL;
|
gchar *lte_rssi = NULL;
|
||||||
gchar *lte_rsrp = NULL;
|
gchar *lte_rsrp = NULL;
|
||||||
gchar *lte_rsrq = NULL;
|
gchar *lte_rsrq = NULL;
|
||||||
gchar *lte_snr = NULL;
|
gchar *lte_snr = NULL;
|
||||||
|
gchar *lte_error_rate = NULL;
|
||||||
gchar *nr5g_rsrp = NULL;
|
gchar *nr5g_rsrp = NULL;
|
||||||
gchar *nr5g_rsrq = NULL;
|
gchar *nr5g_rsrq = NULL;
|
||||||
gchar *nr5g_snr = NULL;
|
gchar *nr5g_snr = NULL;
|
||||||
|
gchar *nr5g_error_rate = NULL;
|
||||||
|
|
||||||
refresh_rate = g_strdup_printf ("%u", mm_modem_signal_get_rate (ctx->modem_signal));
|
refresh_rate = g_strdup_printf ("%u", mm_modem_signal_get_rate (ctx->modem_signal));
|
||||||
|
|
||||||
@@ -165,6 +171,8 @@ print_signal_info (void)
|
|||||||
cdma1x_rssi = g_strdup_printf ("%.2lf", value);
|
cdma1x_rssi = g_strdup_printf ("%.2lf", value);
|
||||||
if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
cdma1x_ecio = g_strdup_printf ("%.2lf", value);
|
cdma1x_ecio = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
cdma1x_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal = mm_modem_signal_peek_evdo (ctx->modem_signal);
|
signal = mm_modem_signal_peek_evdo (ctx->modem_signal);
|
||||||
@@ -177,12 +185,16 @@ print_signal_info (void)
|
|||||||
evdo_sinr = g_strdup_printf ("%.2lf", value);
|
evdo_sinr = g_strdup_printf ("%.2lf", value);
|
||||||
if ((value = mm_signal_get_io (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_io (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
evdo_io = g_strdup_printf ("%.2lf", value);
|
evdo_io = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
evdo_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal = mm_modem_signal_peek_gsm (ctx->modem_signal);
|
signal = mm_modem_signal_peek_gsm (ctx->modem_signal);
|
||||||
if (signal) {
|
if (signal) {
|
||||||
if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_rssi (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
gsm_rssi = g_strdup_printf ("%.2lf", value);
|
gsm_rssi = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
gsm_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal = mm_modem_signal_peek_umts (ctx->modem_signal);
|
signal = mm_modem_signal_peek_umts (ctx->modem_signal);
|
||||||
@@ -193,6 +205,8 @@ print_signal_info (void)
|
|||||||
umts_rscp = g_strdup_printf ("%.2lf", value);
|
umts_rscp = g_strdup_printf ("%.2lf", value);
|
||||||
if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_ecio (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
umts_ecio = g_strdup_printf ("%.2lf", value);
|
umts_ecio = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
umts_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal = mm_modem_signal_peek_lte (ctx->modem_signal);
|
signal = mm_modem_signal_peek_lte (ctx->modem_signal);
|
||||||
@@ -205,6 +219,8 @@ print_signal_info (void)
|
|||||||
lte_rsrp = g_strdup_printf ("%.2lf", value);
|
lte_rsrp = g_strdup_printf ("%.2lf", value);
|
||||||
if ((value = mm_signal_get_snr (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_snr (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
lte_snr = g_strdup_printf ("%.2lf", value);
|
lte_snr = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
lte_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal = mm_modem_signal_peek_nr5g (ctx->modem_signal);
|
signal = mm_modem_signal_peek_nr5g (ctx->modem_signal);
|
||||||
@@ -215,26 +231,34 @@ print_signal_info (void)
|
|||||||
nr5g_rsrp = g_strdup_printf ("%.2lf", value);
|
nr5g_rsrp = g_strdup_printf ("%.2lf", value);
|
||||||
if ((value = mm_signal_get_snr (signal)) != MM_SIGNAL_UNKNOWN)
|
if ((value = mm_signal_get_snr (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
nr5g_snr = g_strdup_printf ("%.2lf", value);
|
nr5g_snr = g_strdup_printf ("%.2lf", value);
|
||||||
|
if ((value = mm_signal_get_error_rate (signal)) != MM_SIGNAL_UNKNOWN)
|
||||||
|
nr5g_error_rate = g_strdup_printf ("%.2lf", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_REFRESH_RATE, refresh_rate, "seconds");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_REFRESH_RATE, refresh_rate, "seconds");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_RSSI, cdma1x_rssi, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_RSSI, cdma1x_rssi, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_ECIO, cdma1x_ecio, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_ECIO, cdma1x_ecio, "dBm");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_CDMA1X_ERROR_RATE, cdma1x_error_rate, "%%");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_RSSI, evdo_rssi, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_RSSI, evdo_rssi, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_ECIO, evdo_ecio, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_ECIO, evdo_ecio, "dB");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_SINR, evdo_sinr, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_SINR, evdo_sinr, "dB");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_IO, evdo_io, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_IO, evdo_io, "dBm");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_EVDO_ERROR_RATE, evdo_error_rate, "%%");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_GSM_RSSI, gsm_rssi, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_GSM_RSSI, gsm_rssi, "dBm");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_GSM_ERROR_RATE, gsm_error_rate, "%%");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSSI, umts_rssi, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSSI, umts_rssi, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSCP, umts_rscp, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_RSCP, umts_rscp, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_ECIO, umts_ecio, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_ECIO, umts_ecio, "dB");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_UMTS_ERROR_RATE, umts_error_rate, "%%");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSSI, lte_rssi, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSSI, lte_rssi, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRQ, lte_rsrq, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRQ, lte_rsrq, "dB");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRP, lte_rsrp, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_RSRP, lte_rsrp, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_SNR, lte_snr, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_SNR, lte_snr, "dB");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_LTE_ERROR_RATE, lte_error_rate, "%%");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_RSRQ, nr5g_rsrq, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_RSRQ, nr5g_rsrq, "dB");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_RSRP, nr5g_rsrp, "dBm");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_RSRP, nr5g_rsrp, "dBm");
|
||||||
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_SNR, nr5g_snr, "dB");
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_SNR, nr5g_snr, "dB");
|
||||||
|
mmcli_output_string_take_typed (MMC_F_SIGNAL_5G_ERROR_RATE, nr5g_error_rate, "%%");
|
||||||
mmcli_output_dump ();
|
mmcli_output_dump ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,12 +267,12 @@ setup_process_reply (gboolean result,
|
|||||||
const GError *error)
|
const GError *error)
|
||||||
{
|
{
|
||||||
if (!result) {
|
if (!result) {
|
||||||
g_printerr ("error: couldn't setup extended signal information retrieval: '%s'\n",
|
g_printerr ("error: couldn't setup signal quality information polling: '%s'\n",
|
||||||
error ? error->message : "unknown error");
|
error ? error->message : "unknown error");
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_print ("Successfully setup extended signal information retrieval\n");
|
g_print ("Successfully setup signal quality information polling\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -164,21 +164,27 @@ static FieldInfo field_infos[] = {
|
|||||||
[MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, },
|
[MMC_F_SIGNAL_REFRESH_RATE] = { "modem.signal.refresh.rate", "refresh rate", MMC_S_MODEM_SIGNAL, },
|
||||||
[MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, },
|
[MMC_F_SIGNAL_CDMA1X_RSSI] = { "modem.signal.cdma1x.rssi", "rssi", MMC_S_MODEM_SIGNAL_CDMA1X, },
|
||||||
[MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, },
|
[MMC_F_SIGNAL_CDMA1X_ECIO] = { "modem.signal.cdma1x.ecio", "ecio", MMC_S_MODEM_SIGNAL_CDMA1X, },
|
||||||
|
[MMC_F_SIGNAL_CDMA1X_ERROR_RATE] = { "modem.signal.cdma1x.error-rate", "error rate", MMC_S_MODEM_SIGNAL_CDMA1X, },
|
||||||
[MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, },
|
[MMC_F_SIGNAL_EVDO_RSSI] = { "modem.signal.evdo.rssi", "rssi", MMC_S_MODEM_SIGNAL_EVDO, },
|
||||||
[MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, },
|
[MMC_F_SIGNAL_EVDO_ECIO] = { "modem.signal.evdo.ecio", "ecio", MMC_S_MODEM_SIGNAL_EVDO, },
|
||||||
[MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, },
|
[MMC_F_SIGNAL_EVDO_SINR] = { "modem.signal.evdo.sinr", "sinr", MMC_S_MODEM_SIGNAL_EVDO, },
|
||||||
[MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, },
|
[MMC_F_SIGNAL_EVDO_IO] = { "modem.signal.evdo.io", "io", MMC_S_MODEM_SIGNAL_EVDO, },
|
||||||
|
[MMC_F_SIGNAL_EVDO_ERROR_RATE] = { "modem.signal.evdo.error-rate", "error rate", MMC_S_MODEM_SIGNAL_EVDO, },
|
||||||
[MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, },
|
[MMC_F_SIGNAL_GSM_RSSI] = { "modem.signal.gsm.rssi", "rssi", MMC_S_MODEM_SIGNAL_GSM, },
|
||||||
|
[MMC_F_SIGNAL_GSM_ERROR_RATE] = { "modem.signal.gsm.error-rate", "error rate", MMC_S_MODEM_SIGNAL_GSM, },
|
||||||
[MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, },
|
[MMC_F_SIGNAL_UMTS_RSSI] = { "modem.signal.umts.rssi", "rssi", MMC_S_MODEM_SIGNAL_UMTS, },
|
||||||
[MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, },
|
[MMC_F_SIGNAL_UMTS_RSCP] = { "modem.signal.umts.rscp", "rscp", MMC_S_MODEM_SIGNAL_UMTS, },
|
||||||
[MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, },
|
[MMC_F_SIGNAL_UMTS_ECIO] = { "modem.signal.umts.ecio", "ecio", MMC_S_MODEM_SIGNAL_UMTS, },
|
||||||
|
[MMC_F_SIGNAL_UMTS_ERROR_RATE] = { "modem.signal.umts.error-rate", "error rate", MMC_S_MODEM_SIGNAL_UMTS, },
|
||||||
[MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, },
|
[MMC_F_SIGNAL_LTE_RSSI] = { "modem.signal.lte.rssi", "rssi", MMC_S_MODEM_SIGNAL_LTE, },
|
||||||
[MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, },
|
[MMC_F_SIGNAL_LTE_RSRQ] = { "modem.signal.lte.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_LTE, },
|
||||||
[MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, },
|
[MMC_F_SIGNAL_LTE_RSRP] = { "modem.signal.lte.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_LTE, },
|
||||||
[MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, },
|
[MMC_F_SIGNAL_LTE_SNR] = { "modem.signal.lte.snr", "s/n", MMC_S_MODEM_SIGNAL_LTE, },
|
||||||
|
[MMC_F_SIGNAL_LTE_ERROR_RATE] = { "modem.signal.lte.error-rate", "error rate", MMC_S_MODEM_SIGNAL_LTE, },
|
||||||
[MMC_F_SIGNAL_5G_RSRQ] = { "modem.signal.5g.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_5G, },
|
[MMC_F_SIGNAL_5G_RSRQ] = { "modem.signal.5g.rsrq", "rsrq", MMC_S_MODEM_SIGNAL_5G, },
|
||||||
[MMC_F_SIGNAL_5G_RSRP] = { "modem.signal.5g.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_5G, },
|
[MMC_F_SIGNAL_5G_RSRP] = { "modem.signal.5g.rsrp", "rsrp", MMC_S_MODEM_SIGNAL_5G, },
|
||||||
[MMC_F_SIGNAL_5G_SNR] = { "modem.signal.5g.snr", "s/n", MMC_S_MODEM_SIGNAL_5G, },
|
[MMC_F_SIGNAL_5G_SNR] = { "modem.signal.5g.snr", "s/n", MMC_S_MODEM_SIGNAL_5G, },
|
||||||
|
[MMC_F_SIGNAL_5G_ERROR_RATE] = { "modem.signal.5g.error-rate", "error rate", MMC_S_MODEM_SIGNAL_5G, },
|
||||||
[MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, },
|
[MMC_F_OMA_FEATURES] = { "modem.oma.features", "features", MMC_S_MODEM_OMA, },
|
||||||
[MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, },
|
[MMC_F_OMA_CURRENT_TYPE] = { "modem.oma.current.type", "type", MMC_S_MODEM_OMA_CURRENT, },
|
||||||
[MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, },
|
[MMC_F_OMA_CURRENT_STATE] = { "modem.oma.current.state", "state", MMC_S_MODEM_OMA_CURRENT, },
|
||||||
|
@@ -175,21 +175,27 @@ typedef enum {
|
|||||||
MMC_F_SIGNAL_REFRESH_RATE,
|
MMC_F_SIGNAL_REFRESH_RATE,
|
||||||
MMC_F_SIGNAL_CDMA1X_RSSI,
|
MMC_F_SIGNAL_CDMA1X_RSSI,
|
||||||
MMC_F_SIGNAL_CDMA1X_ECIO,
|
MMC_F_SIGNAL_CDMA1X_ECIO,
|
||||||
|
MMC_F_SIGNAL_CDMA1X_ERROR_RATE,
|
||||||
MMC_F_SIGNAL_EVDO_RSSI,
|
MMC_F_SIGNAL_EVDO_RSSI,
|
||||||
MMC_F_SIGNAL_EVDO_ECIO,
|
MMC_F_SIGNAL_EVDO_ECIO,
|
||||||
MMC_F_SIGNAL_EVDO_SINR,
|
MMC_F_SIGNAL_EVDO_SINR,
|
||||||
MMC_F_SIGNAL_EVDO_IO,
|
MMC_F_SIGNAL_EVDO_IO,
|
||||||
|
MMC_F_SIGNAL_EVDO_ERROR_RATE,
|
||||||
MMC_F_SIGNAL_GSM_RSSI,
|
MMC_F_SIGNAL_GSM_RSSI,
|
||||||
|
MMC_F_SIGNAL_GSM_ERROR_RATE,
|
||||||
MMC_F_SIGNAL_UMTS_RSSI,
|
MMC_F_SIGNAL_UMTS_RSSI,
|
||||||
MMC_F_SIGNAL_UMTS_RSCP,
|
MMC_F_SIGNAL_UMTS_RSCP,
|
||||||
MMC_F_SIGNAL_UMTS_ECIO,
|
MMC_F_SIGNAL_UMTS_ECIO,
|
||||||
|
MMC_F_SIGNAL_UMTS_ERROR_RATE,
|
||||||
MMC_F_SIGNAL_LTE_RSSI,
|
MMC_F_SIGNAL_LTE_RSSI,
|
||||||
MMC_F_SIGNAL_LTE_RSRQ,
|
MMC_F_SIGNAL_LTE_RSRQ,
|
||||||
MMC_F_SIGNAL_LTE_RSRP,
|
MMC_F_SIGNAL_LTE_RSRP,
|
||||||
MMC_F_SIGNAL_LTE_SNR,
|
MMC_F_SIGNAL_LTE_SNR,
|
||||||
|
MMC_F_SIGNAL_LTE_ERROR_RATE,
|
||||||
MMC_F_SIGNAL_5G_RSRQ,
|
MMC_F_SIGNAL_5G_RSRQ,
|
||||||
MMC_F_SIGNAL_5G_RSRP,
|
MMC_F_SIGNAL_5G_RSRP,
|
||||||
MMC_F_SIGNAL_5G_SNR,
|
MMC_F_SIGNAL_5G_SNR,
|
||||||
|
MMC_F_SIGNAL_5G_ERROR_RATE,
|
||||||
/* OMA section */
|
/* OMA section */
|
||||||
MMC_F_OMA_FEATURES,
|
MMC_F_OMA_FEATURES,
|
||||||
MMC_F_OMA_CURRENT_TYPE,
|
MMC_F_OMA_CURRENT_TYPE,
|
||||||
|
@@ -1029,6 +1029,7 @@ mm_signal_get_io
|
|||||||
mm_signal_get_rsrp
|
mm_signal_get_rsrp
|
||||||
mm_signal_get_rsrq
|
mm_signal_get_rsrq
|
||||||
mm_signal_get_snr
|
mm_signal_get_snr
|
||||||
|
mm_signal_get_error_rate
|
||||||
<SUBSECTION Private>
|
<SUBSECTION Private>
|
||||||
mm_signal_new
|
mm_signal_new
|
||||||
mm_signal_new_from_dictionary
|
mm_signal_new_from_dictionary
|
||||||
@@ -1041,6 +1042,7 @@ mm_signal_set_io
|
|||||||
mm_signal_set_rsrp
|
mm_signal_set_rsrp
|
||||||
mm_signal_set_rsrq
|
mm_signal_set_rsrq
|
||||||
mm_signal_set_snr
|
mm_signal_set_snr
|
||||||
|
mm_signal_set_error_rate
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
MMSignalClass
|
MMSignalClass
|
||||||
MMSignalPrivate
|
MMSignalPrivate
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details:
|
* GNU General Public License for more details:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Aleksander Morgado <aleksander@gnu.org>
|
* Copyright (C) 2013-2021 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
|
* Copyright (C) 2021 Intel Corporation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -39,6 +40,7 @@ G_DEFINE_TYPE (MMSignal, mm_signal, G_TYPE_OBJECT)
|
|||||||
#define PROPERTY_RSRQ "rsrq"
|
#define PROPERTY_RSRQ "rsrq"
|
||||||
#define PROPERTY_RSRP "rsrp"
|
#define PROPERTY_RSRP "rsrp"
|
||||||
#define PROPERTY_SNR "snr"
|
#define PROPERTY_SNR "snr"
|
||||||
|
#define PROPERTY_ERROR_RATE "error-rate"
|
||||||
|
|
||||||
struct _MMSignalPrivate {
|
struct _MMSignalPrivate {
|
||||||
gdouble rssi;
|
gdouble rssi;
|
||||||
@@ -49,6 +51,7 @@ struct _MMSignalPrivate {
|
|||||||
gdouble rsrq;
|
gdouble rsrq;
|
||||||
gdouble rsrp;
|
gdouble rsrp;
|
||||||
gdouble snr;
|
gdouble snr;
|
||||||
|
gdouble error_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -321,6 +324,41 @@ mm_signal_set_snr (MMSignal *self,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_signal_get_error_rate:
|
||||||
|
* @self: a #MMSignal.
|
||||||
|
*
|
||||||
|
* Gets the channel error rate (BER, BLER,... depends on the RAT), in
|
||||||
|
* percentage.
|
||||||
|
*
|
||||||
|
* Applicable to all RAT.
|
||||||
|
*
|
||||||
|
* Returns: the error rate, or %MM_SIGNAL_UNKNOWN if unknown.
|
||||||
|
*
|
||||||
|
* Since: 1.20
|
||||||
|
*/
|
||||||
|
gdouble
|
||||||
|
mm_signal_get_error_rate (MMSignal *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (MM_IS_SIGNAL (self), MM_SIGNAL_UNKNOWN);
|
||||||
|
|
||||||
|
return self->priv->error_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mm_signal_set_error_rate: (skip)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
mm_signal_set_error_rate (MMSignal *self,
|
||||||
|
gdouble value)
|
||||||
|
{
|
||||||
|
g_return_if_fail (MM_IS_SIGNAL (self));
|
||||||
|
|
||||||
|
self->priv->error_rate = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mm_signal_get_dictionary: (skip)
|
* mm_signal_get_dictionary: (skip)
|
||||||
*/
|
*/
|
||||||
@@ -385,6 +423,12 @@ mm_signal_get_dictionary (MMSignal *self)
|
|||||||
PROPERTY_SNR,
|
PROPERTY_SNR,
|
||||||
g_variant_new_double (self->priv->snr));
|
g_variant_new_double (self->priv->snr));
|
||||||
|
|
||||||
|
if (self->priv->error_rate != MM_SIGNAL_UNKNOWN)
|
||||||
|
g_variant_builder_add (&builder,
|
||||||
|
"{sv}",
|
||||||
|
PROPERTY_ERROR_RATE,
|
||||||
|
g_variant_new_double (self->priv->error_rate));
|
||||||
|
|
||||||
return g_variant_ref_sink (g_variant_builder_end (&builder));
|
return g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,6 +456,8 @@ consume_variant (MMSignal *self,
|
|||||||
self->priv->rsrq = g_variant_get_double (value);
|
self->priv->rsrq = g_variant_get_double (value);
|
||||||
else if (g_str_equal (key, PROPERTY_SNR))
|
else if (g_str_equal (key, PROPERTY_SNR))
|
||||||
self->priv->snr = g_variant_get_double (value);
|
self->priv->snr = g_variant_get_double (value);
|
||||||
|
else if (g_str_equal (key, PROPERTY_ERROR_RATE))
|
||||||
|
self->priv->error_rate = g_variant_get_double (value);
|
||||||
else {
|
else {
|
||||||
/* Set error */
|
/* Set error */
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
@@ -499,6 +545,7 @@ mm_signal_init (MMSignal *self)
|
|||||||
self->priv->rsrq = MM_SIGNAL_UNKNOWN;
|
self->priv->rsrq = MM_SIGNAL_UNKNOWN;
|
||||||
self->priv->rsrp = MM_SIGNAL_UNKNOWN;
|
self->priv->rsrp = MM_SIGNAL_UNKNOWN;
|
||||||
self->priv->snr = MM_SIGNAL_UNKNOWN;
|
self->priv->snr = MM_SIGNAL_UNKNOWN;
|
||||||
|
self->priv->error_rate = MM_SIGNAL_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -10,7 +10,8 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details:
|
* GNU General Public License for more details:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Aleksander Morgado <aleksander@gnu.org>
|
* Copyright (C) 2013-2021 Aleksander Morgado <aleksander@aleksander.es>
|
||||||
|
* Copyright (C) 2021 Intel Corporation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MM_SIGNAL_H
|
#ifndef MM_SIGNAL_H
|
||||||
@@ -28,7 +29,7 @@ G_BEGIN_DECLS
|
|||||||
/**
|
/**
|
||||||
* MM_SIGNAL_UNKNOWN:
|
* MM_SIGNAL_UNKNOWN:
|
||||||
*
|
*
|
||||||
* Identifier for an unknown signal value.
|
* Identifier for an unknown signal or error rate value.
|
||||||
*
|
*
|
||||||
* Since: 1.2
|
* Since: 1.2
|
||||||
*/
|
*/
|
||||||
@@ -73,6 +74,7 @@ gdouble mm_signal_get_io (MMSignal *self);
|
|||||||
gdouble mm_signal_get_rsrq (MMSignal *self);
|
gdouble mm_signal_get_rsrq (MMSignal *self);
|
||||||
gdouble mm_signal_get_rsrp (MMSignal *self);
|
gdouble mm_signal_get_rsrp (MMSignal *self);
|
||||||
gdouble mm_signal_get_snr (MMSignal *self);
|
gdouble mm_signal_get_snr (MMSignal *self);
|
||||||
|
gdouble mm_signal_get_error_rate (MMSignal *self);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ModemManager/libmm-glib/mmcli specific methods */
|
/* ModemManager/libmm-glib/mmcli specific methods */
|
||||||
@@ -95,6 +97,7 @@ void mm_signal_set_io (MMSignal *self, gdouble value);
|
|||||||
void mm_signal_set_rsrq (MMSignal *self, gdouble value);
|
void mm_signal_set_rsrq (MMSignal *self, gdouble value);
|
||||||
void mm_signal_set_rsrp (MMSignal *self, gdouble value);
|
void mm_signal_set_rsrp (MMSignal *self, gdouble value);
|
||||||
void mm_signal_set_snr (MMSignal *self, gdouble value);
|
void mm_signal_set_snr (MMSignal *self, gdouble value);
|
||||||
|
void mm_signal_set_error_rate (MMSignal *self, gdouble value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user