diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-01-09 15:08:36 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:48 +0100 |
commit | 4e06e0e67d1f4180e0ea2c86aae3f63701c176d7 (patch) | |
tree | d5bb53a3d8dc36c4fd23552e679bb3ed82d3f13b /src/mm-modem-helpers.c | |
parent | 9641c6375988e5dcd2602bf54c707336acd01ab8 (diff) |
bearer-cdma: implement bearer connection and disconnection
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 2262a4b3..00cfa3ed 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1595,6 +1595,29 @@ mm_cdma_convert_sid (const gchar *sid) return (gint) tmp_sid; } +guint +mm_cdma_get_index_from_rm_protocol (MMModemCdmaRmProtocol protocol, + GError **error) +{ + if (protocol == MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) { + GEnumClass *enum_class; + GEnumValue *value; + + enum_class = G_ENUM_CLASS (g_type_class_ref (MM_TYPE_MODEM_CDMA_RM_PROTOCOL)); + value = g_enum_get_value (enum_class, protocol); + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_FAILED, + "Unexpected RM protocol (%s)", + value->value_nick); + g_type_class_unref (enum_class); + return 0; + } + + /* just substracting 1 from the enum value should give us the index */ + return (protocol - 1); +} + MMModemCdmaRmProtocol mm_cdma_get_rm_protocol_from_index (guint index, GError **error) |