aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2011-08-09 12:15:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-09 12:15:47 -0700
commite592a455745e2f8c781672159a751c70e9d3e770 (patch)
tree0ab6f48eaa09003464a9fe151b081f68a435ba58
parent8bbc3fa4c0456c39c4174ab4be4bf39efe0de091 (diff)
parent6b08f121c817cda19431fa472c9640733df05d6f (diff)
downloadbluez-e592a455745e2f8c781672159a751c70e9d3e770.tar.gz
Merge "Send hci command to disable scan mode in power down function"
-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;