From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: ofono@ofono.org
Subject: Re: [RFC v0 10/20] hfpmodem: Send AT+BAC with the supported codecs
Date: Tue, 12 Mar 2013 14:44:01 -0300 [thread overview]
Message-ID: <20130312174401.GA19904@echo> (raw)
In-Reply-To: <1363098104-16467-11-git-send-email-claudio.takahasi@openbossa.org>
[-- Attachment #1: Type: text/plain, Size: 1811 bytes --]
Hi,
On 11:21 Tue 12 Mar, Claudio Takahasi wrote:
> From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
>
> Before, the AT+BAC command was being sent with fixed information,
> now we send the command (that inform the AG of the codecs supported by
> the HF) with the codecs supported by the registered Handsfree Audio
> Agent.
> ---
> drivers/hfpmodem/slc.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c
> index 646befa..b9b687b 100644
> --- a/drivers/hfpmodem/slc.c
> +++ b/drivers/hfpmodem/slc.c
> @@ -34,6 +34,7 @@
> #include <ofono/log.h>
> #include <ofono/modem.h>
> #include <ofono/emulator.h>
> +#include <ofono/handsfree-audio.h>
>
> #include <drivers/atmodem/atutil.h>
>
> @@ -305,9 +306,27 @@ static void brsf_cb(gboolean ok, GAtResult *result, gpointer user_data)
> if (info->ag_features & HFP_AG_FEATURE_CODEC_NEGOTIATION &&
> info->hf_features & HFP_HF_FEATURE_CODEC_NEGOTIATION) {
>
> + unsigned char codecs[8];
> + GString *str;
> + int i, len;
> +
> + len = ofono_handsfree_get_codecs(codecs, sizeof(codecs));
> + if (len < 0)
This should read "if (len <= 0)". Will fix it in the next round.
> + goto error;
> +
> + str = g_string_new("AT+BAC=");
> +
> + for (i = 0; i < (len - 1); i++)
> + g_string_append_printf(str, "%d,", codecs[i]);
> +
> + g_string_append_printf(str, "%d", codecs[i]);
> +
> slc_establish_data_ref(sed);
> - g_at_chat_send(info->chat, "AT+BAC=1", NULL, bac_cb, sed,
> + g_at_chat_send(info->chat, str->str, NULL, bac_cb, sed,
> slc_establish_data_unref);
> +
> + g_string_free(str, TRUE);
> +
> return;
> }
>
> --
> 1.7.11.7
>
Cheers,
--
Vinicius
next prev parent reply other threads:[~2013-03-12 17:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 14:21 [RFC v0 00/20] HFP1.6: Codec negotiation and HF Connect Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 01/20] handsfree-audio: Add card driver for HFP 1.6 Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 02/20] handsfree-audio: Add user data to card driver Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 03/20] hfp_hf_bluez5: Pass modem as user data Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 04/20] handsfree-audio: Add user data to connect declaration Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 05/20] hfp_hf_bluez5: Add user data to connect implementation Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 06/20] hfp_hf_bluez5: Add HFP 1.6 " Claudio Takahasi
2013-03-14 17:52 ` Vinicius Costa Gomes
2013-03-18 19:15 ` Denis Kenzior
2013-03-12 14:21 ` [RFC v0 07/20] handsfree-audio: Add HFP 1.6 connect hook Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 08/20] handsfree-audio: Add "Connect" reply for HFP 1.6 Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 09/20] handsfree-audio: Add function to get the codecs Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 10/20] hfpmodem: Send AT+BAC with the supported codecs Claudio Takahasi
2013-03-12 17:44 ` Vinicius Costa Gomes [this message]
2013-03-12 14:21 ` [RFC v0 11/20] hfpmodem: Add codec watcher register Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 12/20] hfp_hf_bluez5: Register codec watcher Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 13/20] handsfree-audio: Add function to select the codec Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 14/20] hfp_hf_bluez5: Set the audio codec in the card Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 15/20] handsfree-audio: Send the selected codec Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 16/20] handsfree-audio: Set CVSD as default in the card Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 17/20] handsfree-audio: Use bitmask for supported codecs Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 18/20] handsfree-audio: Disable mSBC if defer is off Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 19/20] bluetooth: Add define for SCO voice settings Claudio Takahasi
2013-03-12 14:21 ` [RFC v0 20/20] handsfree-audio: Add setting SCO air mode Claudio Takahasi
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=20130312174401.GA19904@echo \
--to=vinicius.gomes@openbossa.org \
--cc=ofono@ofono.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