diff --git a/plugins/hciops.c b/plugins/hciops.c
index be8b412..90106df 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
bonding_complete(dev, conn, HCI_UNSPECIFIED_ERROR);
}
-static int hciops_create_bonding(int index, bdaddr_t *bdaddr, uint8_t io_cap)
+static int hciops_create_bonding(int index, bdaddr_t *bdaddr,
+ uint8_t addr_type, uint8_t io_cap)
{
struct dev_info *dev = &devs[index];
BtIOSecLevel sec_level;
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 63af363..8f6788e 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
return 0;
}
-static int mgmt_create_bonding(int index, bdaddr_t *bdaddr, uint8_t io_cap)
+static int mgmt_create_bonding(int index, bdaddr_t *bdaddr, uint8_t addr_type, uint8_t io_cap)
{
char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_pair_device)];
struct mgmt_hdr *hdr = (void *) buf;
hdr->index = htobs(index);
bacpy(&cp->addr.bdaddr, bdaddr);
+ cp->addr.type = addr_type;
cp->io_cap = io_cap;
if (write(mgmt_sock, &buf, sizeof(buf)) < 0)
diff --git a/src/adapter.c b/src/adapter.c
index 25f70ff..89f6ca7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
}
int adapter_create_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr,
- uint8_t io_cap)
+ uint8_t addr_type, uint8_t io_cap)
{
suspend_discovery(adapter);
- return adapter_ops->create_bonding(adapter->dev_id, bdaddr, io_cap);
+ return adapter_ops->create_bonding(adapter->dev_id, bdaddr,
+ addr_type, io_cap);
}
int adapter_cancel_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr)
diff --git a/src/adapter.h b/src/adapter.h
index c1f981a..7265d8b 100644
--- a/src/adapter.h
+++ b/src/adapter.h
int (*restore_powered) (int index);
int (*load_keys) (int index, GSList *keys, gboolean debug_keys);
int (*set_io_capability) (int index, uint8_t io_capability);
- int (*create_bonding) (int index, bdaddr_t *bdaddr, uint8_t io_cap);
+ int (*create_bonding) (int index, bdaddr_t *bdaddr, uint8_t addr_type,
+ uint8_t io_cap);
int (*cancel_bonding) (int index, bdaddr_t *bdaddr);
int (*read_local_oob_data) (int index);
int (*add_remote_oob_data) (int index, bdaddr_t *bdaddr, uint8_t *hash,
uint16_t product, uint16_t version);
int adapter_create_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr,
- uint8_t io_cap);
+ uint8_t addr_type, uint8_t io_cap);
int adapter_cancel_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr);
diff --git a/src/device.c b/src/device.c
index 0133e07..b2c8379 100644
--- a/src/device.c
+++ b/src/device.c
if (device_is_bonded(device))
return btd_error_already_exists(msg);
- err = adapter_create_bonding(adapter, &device->bdaddr, capability);
+ err = adapter_create_bonding(adapter, &device->bdaddr,
+ device->type, capability);
if (err < 0)
return btd_error_failed(msg, strerror(-err));