Return-Path: From: Dmitriy Paliy To: linux-bluetooth@vger.kernel.org Cc: Dmitriy Paliy Subject: [PATCH BlueZ 3/4] Add manager_allow_sniff to audio manager Date: Tue, 24 Jan 2012 14:58:55 +0200 Message-Id: <1327409936-6709-4-git-send-email-dmitriy.paliy@nokia.com> In-Reply-To: <1327409936-6709-1-git-send-email-dmitriy.paliy@nokia.com> References: <1327409936-6709-1-git-send-email-dmitriy.paliy@nokia.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: This patch enables controlling permission to enter into sniff mode, or to leave it, from audio manager through adapter's API. --- audio/manager.c | 15 +++++++++++++++ audio/manager.h | 2 ++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/audio/manager.c b/audio/manager.c index 0b52520..33137ce 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -1418,3 +1418,18 @@ void manager_set_fast_connectable(gboolean enable) adapter_get_dev_id(adapter->btd_adapter)); } } + +void manager_allow_sniff(struct audio_device *dev, gboolean enable) +{ + struct btd_adapter *adapter; + + adapter = manager_find_adapter(&dev->src); + if (!adapter) + return; + + DBG("change link policy for hci%d", adapter_get_dev_id(adapter)); + + if (btd_adapter_allow_sniff(adapter, &dev->dst, enable)) + error("Changing link policy for hci%d failed", + adapter_get_dev_id(adapter)); +} diff --git a/audio/manager.h b/audio/manager.h index 0bf7663..cd1c86d 100644 --- a/audio/manager.h +++ b/audio/manager.h @@ -54,3 +54,5 @@ gboolean manager_allow_headset_connection(struct audio_device *device); /* TRUE to enable fast connectable and FALSE to disable fast connectable for all * audio adapters. */ void manager_set_fast_connectable(gboolean enable); + +void manager_allow_sniff(struct audio_device *dev, gboolean enable); -- 1.7.5.4