From: Claudio Takahasi <[email protected]>
This patch adds a new handsfree-audio public function to read the
available codecs registered by the agent.
---
include/handsfree-audio.h | 1 +
src/handsfree-audio.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/include/handsfree-audio.h b/include/handsfree-audio.h
index 49b0605..f8a731f 100644
--- a/include/handsfree-audio.h
+++ b/include/handsfree-audio.h
@@ -48,6 +48,7 @@ struct ofono_handsfree_card
*ofono_handsfree_card_create(unsigned int vendor,
void *data);
int ofono_handsfree_card_register(struct ofono_handsfree_card *card);
void ofono_handsfree_card_remove(struct ofono_handsfree_card *card);
+int ofono_handsfree_get_codecs(unsigned char *buffer, int buffer_len);
void ofono_handsfree_card_set_data(struct ofono_handsfree_card *card,
void *data);
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 3f24a2a..d1a22db 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -541,6 +541,19 @@ void ofono_handsfree_card_remove(struct
ofono_handsfree_card *card)
g_free(card);
}
+int ofono_handsfree_get_codecs(unsigned char *buffer, int buffer_len)
+{
+ int len;
+
+ if (agent == NULL)
+ return -EIO;
+
+ len = MIN(buffer_len, agent->codecs_len);
+ memcpy(buffer, agent->codecs, len);
+
+ return len;
+}
+
static void agent_free(struct agent *agent)
{
if (agent->watch > 0)
--
1.8.2
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono