This patch removes the hard-coded CVSD codec, and adds the selected
codec in the NewConnection method call, notifying the agent the codec
previously selected for the audio connection.
---
src/handsfree-audio.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 1b0a04d..0d31712 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -74,11 +74,10 @@ static GSList *card_list = 0;
static guint sco_watch = 0;
static GSList *g_drivers = NULL;
-static void send_new_connection(const char *card, int fd)
+static void send_new_connection(const char *card, int fd, uint8_t codec)
{
DBusMessage *msg;
DBusMessageIter iter;
- uint8_t codec = HFP_CODEC_CVSD;
msg = dbus_message_new_method_call(agent->owner, agent->path,
HFP_AUDIO_AGENT_INTERFACE, "NewConnection");
@@ -164,7 +163,7 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition
cond,
card->msg = NULL;
}
- send_new_connection(card->path, nsk);
+ send_new_connection(card->path, nsk, card->selected_codec);
close(nsk);
return TRUE;
@@ -261,7 +260,7 @@ static gboolean sco_connect_cb(GIOChannel *io, GIOCondition
cond,
sk = g_io_channel_unix_get_fd(io);
if (agent)
- send_new_connection(card->path, sk);
+ send_new_connection(card->path, sk, card->selected_codec);
close(sk);
--
1.7.11.7
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono