aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-12-19 12:28:49 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:14:34 +0100
commit55654d5b462f59ec5d6d77de759a1b7012f3d5c6 (patch)
tree6a33fe12123c8e45b160060e38c2ac0143c60635 /cli
parentdae3f9570422fd14f630fa1c060bc26e0f27481c (diff)
cli: new helper to get name of MMBearerIpMethod
Diffstat (limited to 'cli')
-rw-r--r--cli/mmcli-common.c13
-rw-r--r--cli/mmcli-common.h7
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
@@ -238,6 +238,19 @@ mmcli_get_modem_sync (GDBusConnection *connection,
}
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)
{
static GEnumClass *enum_class = NULL;
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_ */