summaryrefslogtreecommitdiffstats
path: root/hcid/agent.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-06-09 04:37:29 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-06-09 04:37:29 +0000
commit8eae4fc054a6f522d9cbc24dbe824838056f0dcf (patch)
tree83c35c3a15e9c20ce944add18fbc7fc8d1f6ece1 /hcid/agent.c
parent4aa07a5ae2035b9ad13c63c3cb85192c85d85252 (diff)
Add support for Simple Pairing User Notification event
Diffstat (limited to 'hcid/agent.c')
-rw-r--r--hcid/agent.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/hcid/agent.c b/hcid/agent.c
index f793a003..da3fb319 100644
--- a/hcid/agent.c
+++ b/hcid/agent.c
@@ -680,6 +680,32 @@ failed:
return -1;
}
+int agent_display_passkey(struct agent *agent, struct device *device,
+ uint32_t passkey)
+{
+ DBusMessage *message;
+
+ message = dbus_message_new_method_call(agent->name, agent->path,
+ "org.bluez.Agent", "DisplayPasskey");
+ if (!message) {
+ error("Couldn't allocate D-Bus message");
+ return -1;
+ }
+
+ dbus_message_append_args(message,
+ DBUS_TYPE_OBJECT_PATH, &device->path,
+ DBUS_TYPE_UINT32, &passkey,
+ DBUS_TYPE_INVALID);
+
+ if (!g_dbus_send_message(connection, message)) {
+ error("D-Bus send failed");
+ dbus_message_unref(message);
+ return -1;
+ }
+
+ return 0;
+}
+
uint8_t agent_get_io_capability(struct agent *agent)
{
return agent->capability;