diff options
author | Denis Kenzior <denkenz@gmail.com> | 2015-10-06 12:48:13 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2015-10-06 09:04:12 -0500 |
commit | c8eb4e384ef09d9107ed0ebfc42bd0f292ceacca (patch) | |
tree | a0ebdaac70827b34682c07f94752edd24e025d83 /src | |
parent | d22e75a7f35222e2ef6fe46dd724a8be9432b641 (diff) | |
download | ofono-c8eb4e384ef09d9107ed0ebfc42bd0f292ceacca.tar.bz2 |
emulator: Add ofono_emulator_set_handsfree_card
Diffstat (limited to 'src')
-rw-r--r-- | src/emulator.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/emulator.c b/src/emulator.c index 1c43e214..0d469724 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -30,6 +30,8 @@ #include <glib.h> +#include <ofono/handsfree-audio.h> + #include "ofono.h" #include "common.h" #include "hfp.h" @@ -48,6 +50,7 @@ struct ofono_emulator { GSList *indicators; guint callsetup_source; int pns_id; + struct ofono_handsfree_card *card; bool slc : 1; unsigned int events_mode : 2; bool events_ind : 1; @@ -990,6 +993,9 @@ static void emulator_unregister(struct ofono_atom *atom) g_at_server_unref(em->server); em->server = NULL; + + ofono_handsfree_card_remove(em->card); + em->card = NULL; } void ofono_emulator_register(struct ofono_emulator *em, int fd) @@ -1435,6 +1441,8 @@ void __ofono_emulator_slc_condition(struct ofono_emulator *em, ofono_info("SLC reached"); em->slc = TRUE; + ofono_handsfree_card_register(em->card); + default: break; } @@ -1460,3 +1468,12 @@ void ofono_emulator_set_hf_indicator_active(struct ofono_emulator *em, sprintf(buf, "+BIND: %d,%d", HFP_HF_INDICATOR_ENHANCED_SAFETY, active); g_at_server_send_unsolicited(em->server, buf); } + +void ofono_emulator_set_handsfree_card(struct ofono_emulator *em, + struct ofono_handsfree_card *card) +{ + if (em == NULL) + return; + + em->card = card; +} |