From c8eb4e384ef09d9107ed0ebfc42bd0f292ceacca Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 6 Oct 2015 12:48:13 +0200 Subject: emulator: Add ofono_emulator_set_handsfree_card --- src/emulator.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') 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 +#include + #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; +} -- cgit v1.2.3