diff options
author | Denis Kenzior <denkenz@gmail.com> | 2013-02-26 11:03:00 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2013-02-26 11:09:48 -0600 |
commit | dfeb91fc08bf119977fd1ccb87b7111a5d7ad4be (patch) | |
tree | 7f2f4301e117fcdbed23b962ee1dd970d751da60 /src/handsfree-audio.c | |
parent | d202b18a9d1e6eb67227bd4a210062a062ead55b (diff) | |
download | ofono-dfeb91fc08bf119977fd1ccb87b7111a5d7ad4be.tar.bz2 |
handsfree-audio: Implement card create / remove
Diffstat (limited to 'src/handsfree-audio.c')
-rw-r--r-- | src/handsfree-audio.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index 4e2cf936..66d9bb02 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -42,6 +42,11 @@ enum hfp_codec { HFP_CODEC_MSBC = 0x02, }; +struct ofono_handsfree_card { + char *remote; + char *local; +}; + struct agent { char *owner; char *path; @@ -52,6 +57,37 @@ struct agent { static struct agent *agent = NULL; static int ref_count = 0; +static GSList *card_list = 0; + +struct ofono_handsfree_card *ofono_handsfree_card_create(const char *remote, + const char *local) +{ + struct ofono_handsfree_card *card; + + card = g_new0(struct ofono_handsfree_card, 1); + + card->remote = g_strdup(remote); + card->local = g_strdup(local); + + card_list = g_slist_prepend(card_list, card); + + return card; +} + +void ofono_handsfree_card_remove(struct ofono_handsfree_card *card) +{ + DBG("%p", card); + + if (card == NULL) + return; + + card_list = g_slist_remove(card_list, card); + + g_free(card->remote); + g_free(card->local); + + g_free(card); +} static void agent_free(struct agent *agent) { |