aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-bearer-3gpp.c11
-rw-r--r--src/mm-bearer-3gpp.h3
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-bearer-3gpp.c b/src/mm-bearer-3gpp.c
index f4c79725..d9e3ed37 100644
--- a/src/mm-bearer-3gpp.c
+++ b/src/mm-bearer-3gpp.c
@@ -776,6 +776,14 @@ disconnect (MMBearer *self,
/*****************************************************************************/
+gchar *
+mm_bearer_3gpp_new_unique_path (void)
+{
+ static guint id = 0;
+
+ return g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++);
+}
+
MMBearer *
mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem,
GAsyncResult *res,
@@ -794,7 +802,6 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
gpointer user_data)
{
GSimpleAsyncResult *result;
- static guint id = 0;
MMBearer3gpp *bearer;
gchar *path;
@@ -824,7 +831,7 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
/* Set modem and path ONLY after having checked input properties, so that
* we don't export invalid bearers. */
- path = g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++);
+ path = mm_bearer_3gpp_new_unique_path ();
g_object_set (bearer,
MM_BEARER_PATH, path,
MM_BEARER_MODEM, modem,
diff --git a/src/mm-bearer-3gpp.h b/src/mm-bearer-3gpp.h
index a1e4d082..8cb205a9 100644
--- a/src/mm-bearer-3gpp.h
+++ b/src/mm-bearer-3gpp.h
@@ -53,6 +53,9 @@ struct _MMBearer3gppClass {
GType mm_bearer_3gpp_get_type (void);
+/* Getter for an unique 3GPP Bearer path */
+gchar *mm_bearer_3gpp_new_unique_path (void);
+
/* Default 3GPP bearer creation implementation */
void mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
MMCommonBearerProperties *properties,