summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArun Kumar Singh <arunkat@gmail.com>2011-02-28 15:18:52 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-01 16:16:38 -0300
commitd68ff374da47f4a37fd31025fdd448931599614b (patch)
treed008b6eae5237b569c90c52fe5ce3e356283b81c /lib
parent7e018c6e02e39faa3b12f144390be4942bd316e6 (diff)
hcitool: Add command to remove a device from LE white list
Diffstat (limited to 'lib')
-rw-r--r--lib/hci.c29
-rw-r--r--lib/hci_lib.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/hci.c b/lib/hci.c
index fc710f49b..0e1518c8d 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1320,6 +1320,35 @@ int hci_le_add_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to)
return 0;
}
+int hci_le_rm_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to)
+{
+ struct hci_request rq;
+ le_remove_device_from_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_REMOVE_DEVICE_FROM_WHITE_LIST;
+ rq.cparam = &cp;
+ rq.clen = LE_REMOVE_DEVICE_FROM_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;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
index fb2c7cb1c..e894e8e25 100644
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -132,6 +132,7 @@ int hci_le_conn_update(int dd, uint16_t handle, uint16_t min_interval,
uint16_t max_interval, uint16_t latency,
uint16_t supervision_timeout, int to);
int hci_le_add_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to);
+int hci_le_rm_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type, int to);
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
int hci_get_route(bdaddr_t *bdaddr);