From: Vinicius Costa Gomes Date: Mon, 8 Apr 2013 22:41:02 +0000 (-0300) Subject: hfpmodem: Send AT+BAC with the supported codecs X-Git-Tag: 1.13~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df1f9bf730a219f14ae906ac6fe35dafc4a10294;p=platform%2Fupstream%2Fofono.git 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. --- 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 #include #include +#include #include @@ -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; }