From patchwork Fri Feb 25 10:04:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 589701 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1PA8E5I023526 for ; Fri, 25 Feb 2011 10:08:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450Ab1BYKIL (ORCPT ); Fri, 25 Feb 2011 05:08:11 -0500 Received: from smtp208.alice.it ([82.57.200.104]:47727 "EHLO smtp208.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932404Ab1BYKIK (ORCPT ); Fri, 25 Feb 2011 05:08:10 -0500 Received: from jcn (82.57.78.169) by smtp208.alice.it (8.5.124.08) id 4C1A271612E5BB57; Fri, 25 Feb 2011 11:04:57 +0100 Received: from ao2 by jcn with local (Exim 4.74) (envelope-from ) id 1PsuXf-0002JG-2s; Fri, 25 Feb 2011 11:04:55 +0100 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 , Antonio Ospite Subject: [PATCH v2 2/3] Re-add manager_get_default_adapter() Date: Fri, 25 Feb 2011 11:04:51 +0100 Message-Id: <1298628292-8842-3-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1298628292-8842-1-git-send-email-ospite@studenti.unina.it> References: <1298628292-8842-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 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Feb 2011 10:08:15 +0000 (UTC) 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);