From 0c561f77956654c654f14daea35e90ad0ba20164 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 20 Nov 2008 16:33:30 -0300 Subject: Introduce Pairable property. As the name suggest it tells when an adapter enter or leaves bondable mode, it works as follow: Pairable=true & Discoverable=true: limited IAC Pairable=true & Discoverable=false: pairable but inquiry scan disabled Pairable=false & Discoverable=true: inquiry scan enabled (with Generic IAC) but new pairings cannot be created (same as if there was no agent) Pairable=false & Discoverable=false: inquiry scan disabled & non-pairable (as if there was no agent) --- src/dbus-hci.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/dbus-hci.c') diff --git a/src/dbus-hci.c b/src/dbus-hci.c index 5b0a1f96..6f9f1bc5 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -239,6 +239,10 @@ int hcid_dbus_request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci) return -1; } + if (!adapter_pairing_initiator(adapter, sba) && + !adapter_is_pairable(adapter)) + return -EPERM; + ba2str(&ci->bdaddr, addr); device = adapter_find_device(adapter, addr); @@ -1466,6 +1470,10 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, if (get_auth_requirements(local, remote, auth) < 0) return -1; + if (!adapter_pairing_initiator(adapter, remote) && + !adapter_is_pairable(adapter)) + return -EPERM; + ba2str(remote, addr); /* For CreatePairedDevice use dedicated bonding */ -- cgit