blob: ce3736021e2f17bbb3c77d4a40c1e18c704fca56 [file] [log] [blame]
From 2a902f071ec21572094ce9cdf54099ad275e7904 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 29 Mar 2012 14:07:13 -0700
Subject: [PATCH 06/13] Display PIN generated by plugin
If a plugin pincode callback sets the display parameter to TRUE, send
the generated PIN to the agent for display using the new DisplayPinCode
agent method, including its fallback to RequestPinCode.
---
src/event.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/event.c b/src/event.c
index d87b6a4..5b60fb3 100644
--- a/src/event.c
+++ b/src/event.c
@@ -127,6 +127,11 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba, gboolean secure)
memset(pin, 0, sizeof(pin));
pinlen = btd_adapter_get_pin(adapter, device, pin, &display);
if (pinlen > 0 && (!secure || pinlen == 16)) {
+ if (display && device_is_bonding(device, NULL))
+ return device_request_authentication(device,
+ AUTH_TYPE_NOTIFY_PINCODE, pin,
+ secure, pincode_cb);
+
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
}
--
1.7.7.3