aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Xie <mattx@android.com>2011-08-12 17:01:56 -0700
committerMatthew Xie <mattx@google.com>2011-08-15 11:47:31 -0700
commit3a4464a0a3af9c62342a16328f990f6fd25666b2 (patch)
tree0ab6f48eaa09003464a9fe151b081f68a435ba58
parent09cd200b6dc9934a20fa0433ab735c88d3dab86b (diff)
downloadbluez-3a4464a0a3af9c62342a16328f990f6fd25666b2.tar.gz
Send hci command to disable scan mode in power down function
Before we power down HCI dev, we should disable Bluetooth chip scan mode so that the chip set would not repond to device outside inquiry and page. bug 5080232 Change-Id: I357a300ad61332c6f95376c0690602cf396e5973
-rw-r--r--plugins/hciops.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 817a180c..ad977295 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -462,8 +462,15 @@ static int hciops_set_pairable(int index, gboolean pairable)
static int hciops_power_off(int index)
{
struct dev_info *dev = &devs[index];
+ uint8_t mode;
- DBG("hci%d", index);
+ DBG("hci%d set scan mode off", index);
+ mode = SCAN_DISABLED;
+ if (hci_send_cmd(dev->sk, OGF_HOST_CTL, OCF_WRITE_SCAN_ENABLE,
+ 1, &mode) < 0)
+ return -errno;
+
+ DBG("hci%d HCIDEVDOWN", index);
if (ioctl(dev->sk, HCIDEVDOWN, index) < 0 && errno != EALREADY)
return -errno;