Permalink
Browse files

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
  • Loading branch information...
1 parent 155b05b commit 4a6a45b3d2bcfbf23937ca6fcf6decbb42a575ae Matthew Xie committed with The Android Automerger Aug 13, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 plugins/hciops.c
View
@@ -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;

0 comments on commit 4a6a45b

Please sign in to comment.