diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2013-04-08 19:41:02 -0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2013-04-09 14:33:41 -0500 |
commit | df1f9bf730a219f14ae906ac6fe35dafc4a10294 (patch) | |
tree | ed3d5980fd108029458d263dc55d374da3170ea9 /drivers/hfpmodem | |
parent | e130f2271523697e4727744ab4878925cb054cae (diff) | |
download | ofono-df1f9bf730a219f14ae906ac6fe35dafc4a10294.tar.bz2 |
hfpmodem: Send AT+BAC with the supported codecs
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.
Diffstat (limited to 'drivers/hfpmodem')
-rw-r--r-- | drivers/hfpmodem/slc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/hfpmodem/slc.c b/drivers/hfpmodem/slc.c index 0e80ef00..40b22a18 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,18 @@ 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) { + char str[32]; + + memset(str, 0, sizeof(str)); + + if (ofono_handsfree_audio_has_wideband()) + sprintf(str, "AT+BAC=%d,%d", HFP_CODEC_CVSD, + HFP_CODEC_MSBC); + else + sprintf(str, "AT+BAC=%d", HFP_CODEC_CVSD); 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, NULL, bac_cb, sed, slc_establish_data_unref); return; } |