From patchwork Wed Jun 8 13:09:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 861492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p58I6rw6010696 for ; Wed, 8 Jun 2011 18:07:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279Ab1FHNJn (ORCPT ); Wed, 8 Jun 2011 09:09:43 -0400 Received: from smtp204.alice.it ([82.57.200.100]:40714 "EHLO smtp204.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753115Ab1FHNJm (ORCPT ); Wed, 8 Jun 2011 09:09:42 -0400 Received: from jcn (87.10.137.111) by smtp204.alice.it (8.5.124.08) id 4DE62ADD00A3166B; Wed, 8 Jun 2011 15:09:38 +0200 Received: from ao2 by jcn with local (Exim 4.76) (envelope-from ) id 1QUIVs-0002QS-4Q; Wed, 08 Jun 2011 15:09:36 +0200 From: Antonio Ospite To: linux-bluetooth@vger.kernel.org Cc: Bastien Nocera , linux-input@vger.kernel.org, Jim Paris , Ranulf Doswell , "Pascal A . Brisset" , Marcin Tolysz , Christian Birchinger , Filipe Lopes , Alan Ott , Mikko Virkkila , Simon Wood , Antonio Ospite Subject: [PATCHv3 2/3] Re-add manager_get_default_adapter() Date: Wed, 8 Jun 2011 15:09:16 +0200 Message-Id: <1307538557-9287-3-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1307538557-9287-1-git-send-email-ospite@studenti.unina.it> References: <1307538557-9287-1-git-send-email-ospite@studenti.unina.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 08 Jun 2011 18:07:11 +0000 (UTC) From: Bastien Nocera Signed-off-by: Bastien Nocera Signed-off-by: Antonio Ospite --- src/manager.c | 5 +++++ src/manager.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/manager.c b/src/manager.c index e805e0c..254ace4 100644 --- a/src/manager.c +++ b/src/manager.c @@ -262,6 +262,11 @@ static void manager_set_default_adapter(int id) DBUS_TYPE_INVALID); } +struct btd_adapter *manager_get_default_adapter(void) +{ + return manager_find_adapter_by_id(default_adapter_id); +} + static void manager_remove_adapter(struct btd_adapter *adapter) { uint16_t dev_id = adapter_get_dev_id(adapter); diff --git a/src/manager.h b/src/manager.h index 05c38b3..4f92d2f 100644 --- a/src/manager.h +++ b/src/manager.h @@ -35,6 +35,7 @@ void manager_cleanup(DBusConnection *conn, const char *path); const char *manager_get_base_path(void); struct btd_adapter *manager_find_adapter(const bdaddr_t *sba); struct btd_adapter *manager_find_adapter_by_id(int id); +struct btd_adapter *manager_get_default_adapter(void); void manager_foreach_adapter(adapter_cb func, gpointer user_data); GSList *manager_get_adapters(void); struct btd_adapter *btd_manager_register_adapter(int id);