summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/dbus.h2
-rw-r--r--src/connman.h3
-rw-r--r--src/main.c4
-rw-r--r--src/profile.c35
4 files changed, 44 insertions, 0 deletions
diff --git a/include/dbus.h b/include/dbus.h
index be98a4ef..a76aea24 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -36,6 +36,8 @@ extern "C" {
#define CONNMAN_ELEMENT_INTERFACE CONNMAN_SERVICE ".Element"
+#define CONNMAN_PROFILE_INTERFACE CONNMAN_SERVICE ".Profile"
+
#define CONNMAN_MANAGER_INTERFACE CONNMAN_SERVICE ".Manager"
#define CONNMAN_MANAGER_PATH "/"
diff --git a/src/connman.h b/src/connman.h
index 47d44f93..4249f33f 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -39,6 +39,9 @@ void __connman_agent_cleanup(void);
int __connman_agent_register(const char *sender, const char *path);
int __connman_agent_unregister(const char *sender, const char *path);
+int __connman_profile_init(DBusConnection *conn);
+void __connman_profile_cleanup(void);
+
void __connman_profile_list(DBusMessageIter *iter);
#include <connman/log.h>
diff --git a/src/main.c b/src/main.c
index 3a5990b5..5f8b4876 100644
--- a/src/main.c
+++ b/src/main.c
@@ -144,6 +144,8 @@ int main(int argc, char *argv[])
__connman_manager_init(conn, option_compat);
+ __connman_profile_init(conn);
+
__connman_plugin_init();
g_free(option_device);
@@ -159,6 +161,8 @@ int main(int argc, char *argv[])
__connman_element_cleanup();
+ __connman_profile_cleanup();
+
__connman_manager_cleanup();
__connman_storage_cleanup();
diff --git a/src/profile.c b/src/profile.c
index 62d90668..223ea434 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -36,3 +36,38 @@ void __connman_profile_list(DBusMessageIter *iter)
dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path);
}
+
+static GDBusMethodTable profile_methods[] = {
+ { },
+};
+
+static DBusConnection *connection = NULL;
+
+int __connman_profile_init(DBusConnection *conn)
+{
+ DBG("conn %p", conn);
+
+ connection = dbus_connection_ref(conn);
+ if (connection == NULL)
+ return -1;
+
+ g_dbus_register_interface(connection, "/profile/default",
+ CONNMAN_PROFILE_INTERFACE,
+ profile_methods,
+ NULL, NULL, NULL, NULL);
+
+ return 0;
+}
+
+void __connman_profile_cleanup(void)
+{
+ DBG("conn %p", connection);
+
+ g_dbus_unregister_interface(connection, "/profile/default",
+ CONNMAN_PROFILE_INTERFACE);
+
+ if (connection == NULL)
+ return;
+
+ dbus_connection_unref(connection);
+}