aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-bearer.c
diff options
context:
space:
mode:
authorSom_SP <somashekhar.puttagangaiah@intel.com>2021-10-21 11:06:24 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-11-03 12:41:51 +0100
commit511859ef0afe049870581e3a55365bc3d3866566 (patch)
treea27b16356a7e24239224f917e2511e13864a8e64 /cli/mmcli-bearer.c
parentd71a0bcf8eba9d7c6ec7949004c806be4f3f3f0d (diff)
api,bearer: add 'uplink-speed' and 'downlink-speed' stats
These values show the rates that have been negotiated with the network during the PS domain attach. These are not the current ongoing data rates associated to the network usage at some given moment. Includes updates by Aleksander Morgado to fix coding style issues and add missing documentation items.
Diffstat (limited to 'cli/mmcli-bearer.c')
-rw-r--r--cli/mmcli-bearer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/mmcli-bearer.c b/cli/mmcli-bearer.c
index e9718e40..db06dbfa 100644
--- a/cli/mmcli-bearer.c
+++ b/cli/mmcli-bearer.c
@@ -279,6 +279,8 @@ print_bearer_info (MMBearer *bearer)
gchar *total_duration = NULL;
gchar *total_bytes_rx = NULL;
gchar *total_bytes_tx = NULL;
+ gchar *uplink_speed = NULL;
+ gchar *downlink_speed = NULL;
if (stats) {
guint64 val;
@@ -309,6 +311,12 @@ print_bearer_info (MMBearer *bearer)
val = mm_bearer_stats_get_total_tx_bytes (stats);
if (val)
total_bytes_tx = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
+ val = mm_bearer_stats_get_uplink_speed (stats);
+ if (val)
+ uplink_speed = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
+ val = mm_bearer_stats_get_downlink_speed (stats);
+ if (val)
+ downlink_speed = g_strdup_printf ("%" G_GUINT64_FORMAT, val);
}
if (start_date)
@@ -321,6 +329,8 @@ print_bearer_info (MMBearer *bearer)
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_DURATION, total_duration);
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_BYTES_RX, total_bytes_rx);
mmcli_output_string_take (MMC_F_BEARER_STATS_TOTAL_BYTES_TX, total_bytes_tx);
+ mmcli_output_string_take (MMC_F_BEARER_STATS_UPLINK_SPEED, uplink_speed);
+ mmcli_output_string_take (MMC_F_BEARER_STATS_DOWNLINK_SPEED, downlink_speed);
}
mmcli_output_dump ();