From 55654d5b462f59ec5d6d77de759a1b7012f3d5c6 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 19 Dec 2011 12:28:49 +0100 Subject: [PATCH] cli: new helper to get name of MMBearerIpMethod --- cli/mmcli-common.c | 13 +++++++++++++ cli/mmcli-common.h | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c index 11b4b831..9eff59fb 100644 --- a/cli/mmcli-common.c +++ b/cli/mmcli-common.c @@ -237,6 +237,19 @@ mmcli_get_modem_sync (GDBusConnection *connection, return found; } +const gchar * +mmcli_get_bearer_ip_method_string (MMBearerIpMethod method) +{ + static GEnumClass *enum_class = NULL; + GEnumValue *value; + + if (!enum_class) + enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_BEARER_IP_METHOD)); + + value = g_enum_get_value (enum_class, method); + return value->value_nick; +} + const gchar * mmcli_get_state_string (MMModemState state) { diff --git a/cli/mmcli-common.h b/cli/mmcli-common.h index 93bf0d41..3273455c 100644 --- a/cli/mmcli-common.h +++ b/cli/mmcli-common.h @@ -36,8 +36,9 @@ MMObject *mmcli_get_modem_finish (GAsyncResult *res); MMObject *mmcli_get_modem_sync (GDBusConnection *connection, const gchar *modem_str); -const gchar *mmcli_get_state_string (MMModemState state); -const gchar *mmcli_get_state_reason_string (MMModemStateChangeReason reason); -const gchar *mmcli_get_lock_string (MMModemLock lock); +const gchar *mmcli_get_bearer_ip_method_string (MMBearerIpMethod method); +const gchar *mmcli_get_state_string (MMModemState state); +const gchar *mmcli_get_state_reason_string (MMModemStateChangeReason reason); +const gchar *mmcli_get_lock_string (MMModemLock lock); #endif /* _MMCLI_COMMON_H_ */