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 09cd200 commit 3a4464a0a3af9c62342a16328f990f6fd25666b2 Matthew Xie committed with Matthew Xie Aug 12, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 plugins/hciops.c
View
9 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;

0 comments on commit 3a4464a

Please sign in to comment.