summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-01-25 07:20:29 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-01-25 07:20:29 +0100
commit59902b6c3b4a66796f18aeda6a6b6556d824a6b0 (patch)
treea7591b303b6bce6b1b2400088da92c341118a30c /src/technology.c
parentd252f9f74f4961e4c1f95c7b447868afd5195b94 (diff)
downloadconnman-59902b6c3b4a66796f18aeda6a6b6556d824a6b0.tar.gz
connman-59902b6c3b4a66796f18aeda6a6b6556d824a6b0.tar.bz2
connman-59902b6c3b4a66796f18aeda6a6b6556d824a6b0.zip
Use the technology type for an unqiue object path
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/technology.c b/src/technology.c
index 33fbc75b..d0a0cd25 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -171,8 +171,8 @@ static struct connman_technology *technology_find(enum connman_service_type type
static struct connman_technology *technology_get(enum connman_service_type type)
{
- static unsigned int counter = 0;
struct connman_technology *technology;
+ const char *str;
DBG("type %d", type);
@@ -182,6 +182,10 @@ static struct connman_technology *technology_get(enum connman_service_type type)
goto done;
}
+ str = __connman_service_type2string(type);
+ if (str == NULL)
+ return NULL;
+
technology = g_try_new0(struct connman_technology, 1);
if (technology == NULL)
return NULL;
@@ -189,8 +193,8 @@ static struct connman_technology *technology_get(enum connman_service_type type)
technology->refcount = 1;
technology->type = type;
- technology->path = g_strdup_printf("%s/technology%d",
- CONNMAN_PATH, counter++);
+ technology->path = g_strdup_printf("%s/technology/%s",
+ CONNMAN_PATH, str);
if (g_dbus_register_interface(connection, technology->path,
CONNMAN_TECHNOLOGY_INTERFACE,