static int mgmt_cancel_bonding(int index, bdaddr_t *bdaddr)
{
+ char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_addr_info)];
+ struct mgmt_hdr *hdr = (void *) buf;
+ struct mgmt_addr_info *cp = (void *) &buf[sizeof(*hdr)];
char addr[18];
ba2str(bdaddr, addr);
DBG("hci%d bdaddr %s", index, addr);
- return -ENOSYS;
+ memset(buf, 0, sizeof(buf));
+ hdr->opcode = htobs(MGMT_OP_CANCEL_PAIR_DEVICE);
+ hdr->len = htobs(sizeof(*cp));
+ hdr->index = htobs(index);
+
+ bacpy(&cp->bdaddr, bdaddr);
+
+ if (write(mgmt_sock, &buf, sizeof(buf)) < 0)
+ return -errno;
+
+ return 0;
}
static int mgmt_read_local_oob_data(int index)