summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@azingo.com>2008-07-09 14:34:35 +0530
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-28 10:36:07 -0300
commit2203f153c53189ec1c30df99b717e035681196e6 (patch)
treebb4fea2d6320c154d34c11f71345e6aedb3896e5
parent29227ad09e8996699e1b1d7e1c90d45fc80cab65 (diff)
Adding device_get_auth.
Signed-off-by: Alok Barsode <alok.barsode@azingo.com>
-rw-r--r--hcid/dbus-hci.c2
-rw-r--r--hcid/device.c5
-rw-r--r--hcid/device.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 91c0a584..389a0b56 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -977,7 +977,7 @@ int hcid_dbus_user_confirm(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
}
/* If no MITM protection required, auto-accept */
- if (!(device->auth & 0x01) && !(type & 0x01)) {
+ if (!(device_get_auth(device) & 0x01) && !(type & 0x01)) {
int dd;
dd = hci_open_dev(adapter->dev_id);
diff --git a/hcid/device.c b/hcid/device.c
index 8de26cf1..8d63590c 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -1002,6 +1002,11 @@ void device_set_auth(struct device *device, uint8_t auth)
device->auth = auth;
}
+uint8_t device_get_auth(struct device *device)
+{
+ return device->auth;
+}
+
int btd_register_device_driver(struct btd_device_driver *driver)
{
const char **uuid;
diff --git a/hcid/device.h b/hcid/device.h
index 243b5f4f..2f1daecf 100644
--- a/hcid/device.h
+++ b/hcid/device.h
@@ -66,6 +66,7 @@ gboolean device_is_temporary(struct device *device);
void device_set_temporary(struct device *device, gboolean temporary);
void device_set_cap(struct device *device, uint8_t cap);
void device_set_auth(struct device *device, uint8_t auth);
+uint8_t device_get_auth(struct device *device);
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )