summaryrefslogtreecommitdiffstats
path: root/src/handsfree-audio.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2013-04-15 10:54:49 -0300
committerDenis Kenzior <denkenz@gmail.com>2013-04-15 06:58:03 -0500
commit9ef5953a562234714389e574703d2506d4cd3112 (patch)
tree67e200b83547ad9dd737979a283f20346e2105e3 /src/handsfree-audio.c
parent7574479e475b9ad6205a289fbf2c24e329b03048 (diff)
downloadofono-9ef5953a562234714389e574703d2506d4cd3112.tar.bz2
handsfree-audio: Implement ofono_handsfree_card_set_codec()
Diffstat (limited to 'src/handsfree-audio.c')
-rw-r--r--src/handsfree-audio.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 50be691f..8e8d4606 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -49,6 +49,7 @@ struct ofono_handsfree_card {
char *local;
char *path;
DBusMessage *msg;
+ unsigned char selected_codec;
const struct ofono_handsfree_card_driver *driver;
void *driver_data;
};
@@ -342,6 +343,8 @@ struct ofono_handsfree_card *ofono_handsfree_card_create(unsigned int vendor,
card = g_new0(struct ofono_handsfree_card, 1);
+ card->selected_codec = HFP_CODEC_CVSD;
+
card_list = g_slist_prepend(card_list, card);
for (l = drivers; l; l = l->next) {
@@ -535,6 +538,23 @@ void ofono_handsfree_card_remove(struct ofono_handsfree_card *card)
g_free(card);
}
+ofono_bool_t ofono_handsfree_card_set_codec(struct ofono_handsfree_card *card,
+ unsigned char codec)
+{
+ if (codec == HFP_CODEC_CVSD)
+ goto done;
+
+ if (codec == HFP_CODEC_MSBC && has_wideband)
+ goto done;
+
+ return FALSE;
+
+done:
+ card->selected_codec = codec;
+
+ return TRUE;
+}
+
ofono_bool_t ofono_handsfree_audio_has_wideband(void)
{
return has_wideband;