summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-08-24 23:14:41 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-08-24 23:14:41 +0000
commita4d0ca683bcbdda57c1035764752669bceb5b339 (patch)
treec9e1a20cea16058ee3c25a8f5180d360de3306f1 /hcid
parent21163a201bdde01099a3054024e0219f0ed10166 (diff)
Add support for extended inquiry results
Diffstat (limited to 'hcid')
-rw-r--r--hcid/security.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/hcid/security.c b/hcid/security.c
index ffc73f8e..7eec9e76 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -568,6 +568,23 @@ static inline void inquiry_result_with_rssi(int dev, bdaddr_t *sba, int plen, vo
}
}
+static inline void extended_inquiry_result(int dev, bdaddr_t *sba, int plen, void *ptr)
+{
+ uint8_t num = *(uint8_t *) ptr++;
+ int i;
+
+ for (i = 0; i < num; i++) {
+ extended_inquiry_info *info = ptr;
+ uint32_t class = info->dev_class[0]
+ | (info->dev_class[1] << 8)
+ | (info->dev_class[2] << 16);
+
+ hcid_dbus_inquiry_result(sba, &info->bdaddr, class, info->rssi);
+
+ ptr += EXTENDED_INQUIRY_INFO_SIZE;
+ }
+}
+
static inline void remote_features_information(int dev, bdaddr_t *sba, void *ptr)
{
evt_read_remote_features_complete *evt = ptr;
@@ -640,6 +657,10 @@ static gboolean io_security_event(GIOChannel *chan, GIOCondition cond, gpointer
case EVT_INQUIRY_RESULT_WITH_RSSI:
inquiry_result_with_rssi(dev, &di->bdaddr, eh->plen, ptr);
break;
+
+ case EVT_EXTENDED_INQUIRY_RESULT:
+ extended_inquiry_result(dev, &di->bdaddr, eh->plen, ptr);
+ break;
}
if (hci_test_bit(HCI_SECMGR, &di->flags))
@@ -697,6 +718,7 @@ void start_security_manager(int hdev)
hci_filter_set_event(EVT_READ_REMOTE_FEATURES_COMPLETE, &flt);
hci_filter_set_event(EVT_INQUIRY_RESULT, &flt);
hci_filter_set_event(EVT_INQUIRY_RESULT_WITH_RSSI, &flt);
+ hci_filter_set_event(EVT_EXTENDED_INQUIRY_RESULT, &flt);
if (setsockopt(dev, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) {
syslog(LOG_ERR, "Can't set filter on hci%d: %s (%d)",
hdev, strerror(errno), errno);