summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-04-23 17:04:33 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-04-23 17:04:33 +0100
commit36a56c493664eb4fe74f640e4d01d18131ce0a03 (patch)
treea67be66cbfdfe8814bc39c1c7417ce7cd81a3739
parent14ef36c854fdd223b4b32cce5c26e39ef6d56ac9 (diff)
downloadconnman-36a56c493664eb4fe74f640e4d01d18131ce0a03.tar.gz
connman-36a56c493664eb4fe74f640e4d01d18131ce0a03.tar.bz2
connman-36a56c493664eb4fe74f640e4d01d18131ce0a03.zip
Export active profile path and ident information
-rw-r--r--src/connman.h3
-rw-r--r--src/manager.c2
-rw-r--r--src/profile.c25
-rw-r--r--src/service.c2
4 files changed, 22 insertions, 10 deletions
diff --git a/src/connman.h b/src/connman.h
index 43392513..0edade44 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -54,7 +54,8 @@ int __connman_profile_init(DBusConnection *conn);
void __connman_profile_cleanup(void);
void __connman_profile_list(DBusMessageIter *iter);
-const char *__connman_profile_active(void);
+const char *__connman_profile_active_ident(void);
+const char *__connman_profile_active_path(void);
void __connman_profile_changed(void);
diff --git a/src/manager.c b/src/manager.c
index 0a59057c..6c079ff3 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -185,7 +185,7 @@ static DBusMessage *get_properties(DBusConnection *conn,
DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
- str = __connman_profile_active();
+ str = __connman_profile_active_path();
if (str != NULL)
connman_dbus_dict_append_variant(&dict, "ActiveProfile",
DBUS_TYPE_OBJECT_PATH, &str);
diff --git a/src/profile.c b/src/profile.c
index f12bdb84..729c7de2 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -28,15 +28,22 @@
#include "connman.h"
-#define PROFILE_DEFAULT "/profile/default"
+#define PROFILE_DEFAULT_IDENT "default"
static DBusConnection *connection = NULL;
-const char *__connman_profile_active(void)
+const char *__connman_profile_active_ident(void)
{
DBG("");
- return PROFILE_DEFAULT;
+ return PROFILE_DEFAULT_IDENT;
+}
+
+const char *__connman_profile_active_path(void)
+{
+ DBG("");
+
+ return "/profile/" PROFILE_DEFAULT_IDENT;
}
static void append_services(DBusMessageIter *entry)
@@ -60,7 +67,7 @@ static void append_services(DBusMessageIter *entry)
void __connman_profile_changed(void)
{
- const char *path = __connman_profile_active();
+ const char *path = __connman_profile_active_path();
DBusMessage *signal;
DBusMessageIter entry;
@@ -141,7 +148,7 @@ int __connman_profile_remove_network(struct connman_network *network)
void __connman_profile_list(DBusMessageIter *iter)
{
- const char *path = __connman_profile_active();
+ const char *path = __connman_profile_active_path();
DBG("");
@@ -193,13 +200,15 @@ static GDBusSignalTable profile_signals[] = {
int __connman_profile_init(DBusConnection *conn)
{
+ const char *path = __connman_profile_active_path();
+
DBG("conn %p", conn);
connection = dbus_connection_ref(conn);
if (connection == NULL)
return -1;
- g_dbus_register_interface(connection, PROFILE_DEFAULT,
+ g_dbus_register_interface(connection, path,
CONNMAN_PROFILE_INTERFACE,
profile_methods, profile_signals,
NULL, NULL, NULL);
@@ -209,9 +218,11 @@ int __connman_profile_init(DBusConnection *conn)
void __connman_profile_cleanup(void)
{
+ const char *path = __connman_profile_active_path();
+
DBG("conn %p", connection);
- g_dbus_unregister_interface(connection, PROFILE_DEFAULT,
+ g_dbus_unregister_interface(connection, path,
CONNMAN_PROFILE_INTERFACE);
if (connection == NULL)
diff --git a/src/service.c b/src/service.c
index 9522294b..ec09cc1c 100644
--- a/src/service.c
+++ b/src/service.c
@@ -705,7 +705,7 @@ struct connman_service *connman_service_get(const char *identifier)
static int service_register(struct connman_service *service)
{
- const char *path = __connman_profile_active();
+ const char *path = __connman_profile_active_path();
DBG("service %p", service);