summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSudha Bheemanna <b.sudha@samsung.com>2016-08-25 11:41:34 +0530
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:53:08 +0900
commit2d47926cecc5898da1e701f4287a920a70fb0f1f (patch)
tree51ed59238f9344e06331ad42f13f5fdf4d289331 /net
parent6f2fa4bc0de1289963096b09aed8b4e7cb418564 (diff)
Bluetooth: Add stop LE auto connection feature
Added new MGMT command to disable LE auto connection. Change-Id: I1f5f61b83227501ad54019008b405fd47fd722a3 Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 230c7b801293..ce93c59c45a2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6898,6 +6898,24 @@ void mgmt_le_discovering(struct hci_dev *hdev, u8 discovering)
mgmt_event(MGMT_EV_DISCOVERING, hdev, &ev, sizeof(ev), NULL);
}
+
+static int disable_le_auto_connect(struct sock *sk, struct hci_dev *hdev,
+ void *data, u16 len)
+{
+ int err;
+
+ BT_DBG("%s", hdev->name);
+
+ hci_dev_lock(hdev);
+
+ err = hci_send_cmd(hdev, HCI_OP_LE_CREATE_CONN_CANCEL, 0, NULL);
+ if (err < 0)
+ BT_ERR("HCI_OP_LE_CREATE_CONN_CANCEL is failed");
+
+ hci_dev_unlock(hdev);
+
+ return err;
+}
#endif /* TIZEN_BT */
static bool ltk_is_valid(struct mgmt_ltk_info *key)
@@ -8711,6 +8729,7 @@ static const struct hci_mgmt_handler tizen_mgmt_handlers[] = {
{ set_disable_threshold, MGMT_SET_RSSI_DISABLE_SIZE },
{ start_le_discovery, MGMT_START_LE_DISCOVERY_SIZE },
{ stop_le_discovery, MGMT_STOP_LE_DISCOVERY_SIZE },
+ { disable_le_auto_connect, MGMT_DISABLE_LE_AUTO_CONNECT_SIZE },
};
#endif