diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-24 11:01:12 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-24 11:01:47 +0200 |
commit | 63e1b0396180a9b412729e7757da19141a097618 (patch) | |
tree | 165a39ff025c875380373b6470ec96d9793f1d53 /plugins | |
parent | 1876483852eae481acd1e060131d011519200ddf (diff) | |
download | bluez-63e1b0396180a9b412729e7757da19141a097618.tar.gz bluez-63e1b0396180a9b412729e7757da19141a097618.tar.xz bluez-63e1b0396180a9b412729e7757da19141a097618.zip |
mgmtops: Set discovery type based on real capabilities
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mgmtops.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c index e9c6f0b1..2c062e51 100644 --- a/plugins/mgmtops.c +++ b/plugins/mgmtops.c @@ -132,10 +132,6 @@ static void add_controller(uint16_t index) info->valid = TRUE; - hci_set_bit(MGMT_ADDR_BREDR, &info->discov_type); - hci_set_bit(MGMT_ADDR_LE_PUBLIC, &info->discov_type); - hci_set_bit(MGMT_ADDR_LE_RANDOM, &info->discov_type); - DBG("Added controller %u", index); } @@ -1850,9 +1846,20 @@ static int mgmt_start_discovery(int index) struct mgmt_hdr *hdr = (void *) buf; struct mgmt_cp_start_discovery *cp = (void *) &buf[sizeof(*hdr)]; struct controller_info *info = &controllers[index]; + uint8_t type; DBG("index %d", index); + if (mgmt_bredr(info->current_settings)) + hci_set_bit(MGMT_ADDR_BREDR, &type); + + if (mgmt_low_energy(info->current_settings)) { + hci_set_bit(MGMT_ADDR_LE_PUBLIC, &type); + hci_set_bit(MGMT_ADDR_LE_RANDOM, &type); + } + + info->discov_type = type; + memset(buf, 0, sizeof(buf)); hdr->opcode = htobs(MGMT_OP_START_DISCOVERY); hdr->len = htobs(sizeof(*cp)); |