summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-12-15 01:33:54 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-12-15 01:33:54 +0100
commit0ab621bb86df7097c06178bf091b768e5b2e7a2b (patch)
tree9f0fd9f0c4163bacaec1e9c78934baf364ff0473 /client
parentd8d4b4f0c0ed5ddce7df3cf7ddad8322a9787c45 (diff)
downloadbluez-0ab621bb86df7097c06178bf091b768e5b2e7a2b.tar.gz
client: Use constants for agent path and interface strings
Diffstat (limited to 'client')
-rw-r--r--client/agent.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/client/agent.c b/client/agent.c
index 0a82e2191..0deae1b5a 100644
--- a/client/agent.c
+++ b/client/agent.c
@@ -32,6 +32,9 @@
#include "display.h"
#include "agent.h"
+#define AGENT_PATH "/org/bluez/agent"
+#define AGENT_INTERFACE "org.bluez.Agent1"
+
static gboolean agent_registered = FALSE;
static DBusMessage *release_agent(DBusConnection *conn,
@@ -39,8 +42,7 @@ static DBusMessage *release_agent(DBusConnection *conn,
{
agent_registered = FALSE;
- g_dbus_unregister_interface(conn, "/org/bluez/agent",
- "org.bluez.Agent1");
+ g_dbus_unregister_interface(conn, AGENT_PATH, AGENT_INTERFACE);
return dbus_message_new_method_return(msg);
}
@@ -57,8 +59,8 @@ void agent_register(DBusConnection *conn, GDBusProxy *manager)
return;
}
- if (g_dbus_register_interface(conn, "/org/bluez/agent",
- "org.bluez.Agent1", methods,
+ if (g_dbus_register_interface(conn, AGENT_PATH,
+ AGENT_INTERFACE, methods,
NULL, NULL, NULL, NULL) == FALSE) {
printf("Failed to register agent object\n");
return;
@@ -74,8 +76,8 @@ void agent_unregister(DBusConnection *conn, GDBusProxy *manager)
return;
}
- if (g_dbus_unregister_interface(conn, "/org/bluez/agent",
- "org.bluez.Agent1") == FALSE) {
+ if (g_dbus_unregister_interface(conn, AGENT_PATH,
+ AGENT_INTERFACE) == FALSE) {
printf("Failed to unregister agent object\n");
return;
}