diff options
author | Arun Kumar Singh <arunkat@gmail.com> | 2011-02-28 15:18:50 -0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-03-01 16:16:35 -0300 |
commit | 265059a149c78e780bdbed275feb250ab5276a65 (patch) | |
tree | d652e526d89e97d4a61d886d557bdad55e985e3b /lib/hci.c | |
parent | a0ba561d9077d6e43ebbd124c2f3959b8695fb24 (diff) | |
download | bluez-265059a149c78e780bdbed275feb250ab5276a65.tar.gz |
hcitool: Add command to add a device to LE White List
Diffstat (limited to 'lib/hci.c')
-rw-r--r-- | lib/hci.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -1291,6 +1291,35 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) return 0; } +int hci_le_add_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to) +{ + struct hci_request rq; + le_add_device_to_white_list_cp cp; + uint8_t status; + + memset(&cp, 0, sizeof(cp)); + cp.bdaddr_type = type; + bacpy(&cp.bdaddr, bdaddr); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LE_CTL; + rq.ocf = OCF_LE_ADD_DEVICE_TO_WHITE_LIST; + rq.cparam = &cp; + rq.clen = LE_ADD_DEVICE_TO_WHITE_LIST_CP_SIZE; + rq.rparam = &status; + rq.rlen = 1; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_local_name(int dd, int len, char *name, int to) { read_local_name_rp rp; |