diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 2c062e5..5740e9c 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
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);
+ info->discov_type = 0;
+
if (mgmt_bredr(info->current_settings))
- hci_set_bit(MGMT_ADDR_BREDR, &type);
+ hci_set_bit(MGMT_ADDR_BREDR, &info->discov_type);
if (mgmt_low_energy(info->current_settings)) {
- hci_set_bit(MGMT_ADDR_LE_PUBLIC, &type);
- hci_set_bit(MGMT_ADDR_LE_RANDOM, &type);
+ hci_set_bit(MGMT_ADDR_LE_PUBLIC, &info->discov_type);
+ hci_set_bit(MGMT_ADDR_LE_RANDOM, &info->discov_type);
}
- info->discov_type = type;
-
memset(buf, 0, sizeof(buf));
hdr->opcode = htobs(MGMT_OP_START_DISCOVERY);
hdr->len = htobs(sizeof(*cp));