From: "Frédéric Danis" <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v11 10/12] audio: Replace headset and gateway by telephony
Date: Thu, 28 Jun 2012 18:15:53 +0200 [thread overview]
Message-ID: <1340900155-26311-11-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1340900155-26311-1-git-send-email-frederic.danis@linux.intel.com>
Replace Headset and Gateway configuration options by new
Telephony option.
Remove HFP option in Headset section as it is no more
relevant.
---
audio/audio.conf | 6 +---
audio/manager.c | 90 ++++++++++++------------------------------------------
audio/manager.h | 4 +--
3 files changed, 22 insertions(+), 78 deletions(-)
diff --git a/audio/audio.conf b/audio/audio.conf
index fd6092a..d3e6447 100644
--- a/audio/audio.conf
+++ b/audio/audio.conf
@@ -9,7 +9,7 @@
# If we want to disable support for specific services
# Defaults to supporting all implemented services
-#Disable=Gateway,Source,Socket
+#Disable=Source,Socket
# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
# Defaults to HCI
@@ -25,10 +25,6 @@
# service interacts with remote headset devices)
[Headset]
-# Set to true to support HFP, false means only HSP is supported
-# Defaults to true
-HFP=true
-
# Maximum number of connected HSP/HFP devices per adapter. Defaults to 1
MaxConnected=1
diff --git a/audio/manager.c b/audio/manager.c
index 359a0cf..15db2f3 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -102,9 +102,7 @@ static GSList *adapters = NULL;
static GSList *devices = NULL;
static struct enabled_interfaces enabled = {
- .hfp = TRUE,
- .headset = TRUE,
- .gateway = FALSE,
+ .telephony = TRUE,
.sink = TRUE,
.source = FALSE,
.control = TRUE,
@@ -129,13 +127,13 @@ gboolean server_is_enabled(bdaddr_t *src, uint16_t svc)
{
switch (svc) {
case HEADSET_SVCLASS_ID:
- return enabled.headset;
+ return enabled.telephony;
case HEADSET_AGW_SVCLASS_ID:
return FALSE;
case HANDSFREE_SVCLASS_ID:
- return enabled.headset && enabled.hfp;
+ return enabled.telephony;
case HANDSFREE_AGW_SVCLASS_ID:
- return enabled.gateway;
+ return enabled.telephony;
case AUDIO_SINK_SVCLASS_ID:
return enabled.sink;
case AUDIO_SOURCE_SVCLASS_ID:
@@ -192,7 +190,7 @@ static void handle_uuid(const char *uuidstr, struct audio_device *device)
break;
case HANDSFREE_AGW_SVCLASS_ID:
DBG("Found Handsfree AG record");
- if (enabled.gateway && (device->gateway == NULL))
+ if (enabled.telephony && (device->gateway == NULL))
device->gateway = gateway_init(device);
break;
case AUDIO_SINK_SVCLASS_ID:
@@ -352,7 +350,7 @@ static void state_changed(struct btd_adapter *adapter, gboolean powered)
telephony = FALSE;
}
-static int headset_server_probe(struct btd_adapter *adapter)
+static int telephony_server_probe(struct btd_adapter *adapter)
{
struct audio_adapter *adp;
const gchar *path = adapter_get_path(adapter);
@@ -370,7 +368,7 @@ static int headset_server_probe(struct btd_adapter *adapter)
return 0;
}
-static void headset_server_remove(struct btd_adapter *adapter)
+static void telephony_server_remove(struct btd_adapter *adapter)
{
struct audio_adapter *adp;
const gchar *path = adapter_get_path(adapter);
@@ -386,31 +384,6 @@ static void headset_server_remove(struct btd_adapter *adapter)
audio_adapter_unref(adp);
}
-static int gateway_server_probe(struct btd_adapter *adapter)
-{
- struct audio_adapter *adp;
-
- adp = audio_adapter_get(adapter);
- if (!adp)
- return -EINVAL;
-
- return 0;
-}
-
-static void gateway_server_remove(struct btd_adapter *adapter)
-{
- struct audio_adapter *adp;
- const gchar *path = adapter_get_path(adapter);
-
- DBG("path %s", path);
-
- adp = find_adapter(adapters, adapter);
- if (!adp)
- return;
-
- audio_adapter_unref(adp);
-}
-
static int a2dp_server_probe(struct btd_adapter *adapter)
{
struct audio_adapter *adp;
@@ -535,16 +508,10 @@ static struct btd_device_driver audio_driver = {
.remove = audio_remove,
};
-static struct btd_adapter_driver headset_server_driver = {
- .name = "audio-headset",
- .probe = headset_server_probe,
- .remove = headset_server_remove,
-};
-
-static struct btd_adapter_driver gateway_server_driver = {
- .name = "audio-gateway",
- .probe = gateway_server_probe,
- .remove = gateway_server_remove,
+static struct btd_adapter_driver telephony_server_driver = {
+ .name = "telephony",
+ .probe = telephony_server_probe,
+ .remove = telephony_server_remove,
};
static struct btd_adapter_driver a2dp_server_driver = {
@@ -583,10 +550,8 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
list = g_key_file_get_string_list(config, "General", "Enable",
NULL, NULL);
for (i = 0; list && list[i] != NULL; i++) {
- if (g_str_equal(list[i], "Headset"))
- enabled.headset = TRUE;
- else if (g_str_equal(list[i], "Gateway"))
- enabled.gateway = TRUE;
+ if (g_str_equal(list[i], "Telephony"))
+ enabled.telephony = TRUE;
else if (g_str_equal(list[i], "Sink"))
enabled.sink = TRUE;
else if (g_str_equal(list[i], "Source"))
@@ -604,10 +569,8 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
list = g_key_file_get_string_list(config, "General", "Disable",
NULL, NULL);
for (i = 0; list && list[i] != NULL; i++) {
- if (g_str_equal(list[i], "Headset"))
- enabled.headset = FALSE;
- else if (g_str_equal(list[i], "Gateway"))
- enabled.gateway = FALSE;
+ if (g_str_equal(list[i], "Telephony"))
+ enabled.telephony = FALSE;
else if (g_str_equal(list[i], "Sink"))
enabled.sink = FALSE;
else if (g_str_equal(list[i], "Source"))
@@ -628,13 +591,6 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
} else
auto_connect = b;
- b = g_key_file_get_boolean(config, "Headset", "HFP",
- &err);
- if (err)
- g_clear_error(&err);
- else
- enabled.hfp = b;
-
err = NULL;
i = g_key_file_get_integer(config, "Headset", "MaxConnected",
&err);
@@ -651,11 +607,8 @@ proceed:
if (enabled.media)
btd_register_adapter_driver(&media_server_driver);
- if (enabled.headset)
- btd_register_adapter_driver(&headset_server_driver);
-
- if (enabled.gateway)
- btd_register_adapter_driver(&gateway_server_driver);
+ if (enabled.telephony)
+ btd_register_adapter_driver(&telephony_server_driver);
if (enabled.source || enabled.sink)
btd_register_adapter_driver(&a2dp_server_driver);
@@ -665,7 +618,7 @@ proceed:
btd_register_device_driver(&audio_driver);
- *enable_sco = (enabled.gateway || enabled.headset);
+ *enable_sco = (enabled.telephony);
return 0;
}
@@ -690,11 +643,8 @@ void audio_manager_exit(void)
if (enabled.media)
btd_unregister_adapter_driver(&media_server_driver);
- if (enabled.headset)
- btd_unregister_adapter_driver(&headset_server_driver);
-
- if (enabled.gateway)
- btd_unregister_adapter_driver(&gateway_server_driver);
+ if (enabled.telephony)
+ btd_unregister_adapter_driver(&telephony_server_driver);
if (enabled.source || enabled.sink)
btd_unregister_adapter_driver(&a2dp_server_driver);
diff --git a/audio/manager.h b/audio/manager.h
index f1d3021..645134c 100644
--- a/audio/manager.h
+++ b/audio/manager.h
@@ -23,9 +23,7 @@
*/
struct enabled_interfaces {
- gboolean hfp;
- gboolean headset;
- gboolean gateway;
+ gboolean telephony;
gboolean sink;
gboolean source;
gboolean control;
--
1.7.9.5
next prev parent reply other threads:[~2012-06-28 16:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-28 16:15 [PATCH v11 00/12] Add org.bluez.Telephony interface Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 01/12] audio: Move telephony drivers to D-Bus interface Frédéric Danis
2012-07-05 14:21 ` Mikel Astiz
2012-07-06 13:07 ` Frederic Danis
2012-06-28 16:15 ` [PATCH v11 02/12] audio: Simplify org.bluez.Headset Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 03/12] audio: Remove dummy telephony driver Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 04/12] audio: Remove maemo5 " Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 05/12] audio: Remove maemo6 " Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 06/12] audio: Remove oFono " Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 07/12] audio: Move HFP/HSP AG servers to telephony.c Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 08/12] audio: Send transport path to telephony agent Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 09/12] audio: Move HFP HF server to telephony.c Frédéric Danis
2012-06-28 16:15 ` Frédéric Danis [this message]
2012-06-28 16:15 ` [PATCH v11 11/12] audio: Add DUN GW to org.bluez.Telephony Frédéric Danis
2012-06-28 16:15 ` [PATCH v11 12/12] audio: Add SAP " Frédéric Danis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340900155-26311-11-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).