From 842ed094ea0d3d591685ea3ac3423b3a57009246 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 4 Sep 2008 14:15:20 +0300 Subject: Implement basic HFP response and hold support --- audio/telephony-dummy.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'audio/telephony-dummy.c') diff --git a/audio/telephony-dummy.c b/audio/telephony-dummy.c index 59eacc89..73d367c1 100644 --- a/audio/telephony-dummy.c +++ b/audio/telephony-dummy.c @@ -35,6 +35,14 @@ static gboolean events_enabled = FALSE; +/* Response and hold state + * -1 = none + * 0 = incoming call is put on hold in the AG + * 1 = held incoming call is accepted in the AG + * 2 = held incoming call is rejected in the AG + */ +static int response_and_hold = -1; + static struct indicator indicators[] = { { "battchg", "0-5", 5 }, @@ -61,9 +69,23 @@ struct indicator *telephony_indicators_req(void) return indicators; } -int telephony_set_event_reporting(int ind) +int telephony_event_reporting_req(int ind) { events_enabled = ind == 1 ? TRUE : FALSE; + + if (events_enabled) + telephony_response_and_hold_ind(response_and_hold); + + return 0; +} + +int telephony_response_and_hold_req(int rh) +{ + response_and_hold = rh; + + telephony_response_and_hold_ind(response_and_hold); + + return 0; } int telephony_init(void) -- cgit