* [PATCH 2/4] emulator: Add API to force indicator event
2012-03-09 15:26 [PATCH 1/4] voicecall: Improve transitions check =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-09 15:26 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14 2:45 ` Denis Kenzior
2012-03-09 15:26 ` [PATCH 3/4] emulator: Force indicator event implementation =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2012-03-09 15:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 661 bytes --]
For AT+CHLD=2, +CIEV unsollicited event for callheld should be sent even
if it does not change
---
include/emulator.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/emulator.h b/include/emulator.h
index 5cd894b..e6bfcbd 100644
--- a/include/emulator.h
+++ b/include/emulator.h
@@ -105,6 +105,9 @@ enum ofono_emulator_request_type ofono_emulator_request_get_type(
void ofono_emulator_set_indicator(struct ofono_emulator *em,
const char *name, int value);
+void ofono_emulator_indicator_set_forced(struct ofono_emulator *em,
+ const char *name);
+
#ifdef __cplusplus
}
#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 2/4] emulator: Add API to force indicator event
2012-03-09 15:26 ` [PATCH 2/4] emulator: Add API to force indicator event =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-14 2:45 ` Denis Kenzior
0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-03-14 2:45 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
Hi Frédéric,
On 03/09/2012 09:26 AM, Frédéric Danis wrote:
> For AT+CHLD=2, +CIEV unsollicited event for callheld should be sent even
> if it does not change
> ---
> include/emulator.h | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/include/emulator.h b/include/emulator.h
> index 5cd894b..e6bfcbd 100644
> --- a/include/emulator.h
> +++ b/include/emulator.h
> @@ -105,6 +105,9 @@ enum ofono_emulator_request_type ofono_emulator_request_get_type(
> void ofono_emulator_set_indicator(struct ofono_emulator *em,
> const char *name, int value);
>
> +void ofono_emulator_indicator_set_forced(struct ofono_emulator *em,
> + const char *name);
> +
Please name this ofono_emulator_set_indicator_forced for consistency.
> #ifdef __cplusplus
> }
> #endif
Regards,
-Denis
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/4] emulator: Force indicator event implementation
2012-03-09 15:26 [PATCH 1/4] voicecall: Improve transitions check =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-09 15:26 ` [PATCH 2/4] emulator: Add API to force indicator event =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-09 15:26 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14 2:47 ` Denis Kenzior
2012-03-09 15:26 ` [PATCH 4/4] voicecall: Force callheld update after calls swap =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14 2:44 ` [PATCH 1/4] voicecall: Improve transitions check Denis Kenzior
3 siblings, 1 reply; 7+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2012-03-09 15:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]
---
src/emulator.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 0f1ceca..34329f0 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -62,6 +62,7 @@ struct indicator {
gboolean deferred;
gboolean active;
gboolean mandatory;
+ gboolean forced;
};
static void emulator_debug(const char *str, void *data)
@@ -1181,11 +1182,12 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
ind = find_indicator(em, name, &i);
- if (ind == NULL || ind->value == value || value < ind->min
- || value > ind->max)
+ if (ind == NULL || (ind->value == value && !ind->forced)
+ || value < ind->min || value > ind->max)
return;
ind->value = value;
+ ind->forced = FALSE;
call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
cs_ind = find_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, NULL);
@@ -1245,3 +1247,15 @@ start_ring:
em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
notify_ring, em);
}
+
+void ofono_emulator_indicator_set_forced(struct ofono_emulator *em,
+ const char *name)
+{
+ struct indicator *ind;
+
+ ind = find_indicator(em, name, NULL);
+ if (ind == NULL)
+ return;
+
+ ind->forced = TRUE;
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 3/4] emulator: Force indicator event implementation
2012-03-09 15:26 ` [PATCH 3/4] emulator: Force indicator event implementation =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-14 2:47 ` Denis Kenzior
0 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-03-14 2:47 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]
Hi Frédéric,
On 03/09/2012 09:26 AM, Frédéric Danis wrote:
> ---
> src/emulator.c | 18 ++++++++++++++++--
> 1 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/src/emulator.c b/src/emulator.c
> index 0f1ceca..34329f0 100644
> --- a/src/emulator.c
> +++ b/src/emulator.c
> @@ -62,6 +62,7 @@ struct indicator {
> gboolean deferred;
> gboolean active;
> gboolean mandatory;
> + gboolean forced;
> };
>
> static void emulator_debug(const char *str, void *data)
> @@ -1181,11 +1182,12 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
>
> ind = find_indicator(em, name, &i);
>
> - if (ind == NULL || ind->value == value || value < ind->min
> - || value > ind->max)
> + if (ind == NULL || (ind->value == value && !ind->forced)
> + || value < ind->min || value > ind->max)
> return;
>
> ind->value = value;
> + ind->forced = FALSE;
>
> call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
> cs_ind = find_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, NULL);
> @@ -1245,3 +1247,15 @@ start_ring:
> em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
> notify_ring, em);
> }
> +
> +void ofono_emulator_indicator_set_forced(struct ofono_emulator *em,
> + const char *name)
Why not just take the same arguments as ofono_emulator_set_indicator and...
> +{
> + struct indicator *ind;
> +
> + ind = find_indicator(em, name, NULL);
> + if (ind == NULL)
> + return;
> +
> + ind->forced = TRUE;
> +}
just simply update the value and emit the CIEV. We only use it in a
very specific circumstance anyway.
Regards,
-Denis
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] voicecall: Force callheld update after calls swap
2012-03-09 15:26 [PATCH 1/4] voicecall: Improve transitions check =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-09 15:26 ` [PATCH 2/4] emulator: Add API to force indicator event =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-09 15:26 ` [PATCH 3/4] emulator: Force indicator event implementation =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-09 15:26 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2012-03-14 2:44 ` [PATCH 1/4] voicecall: Improve transitions check Denis Kenzior
3 siblings, 0 replies; 7+ messages in thread
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis @ 2012-03-09 15:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]
In HFP spec, a callheld indicator update should be sent after swapping
calls, even if callheld value has not changed.
---
src/voicecall.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/voicecall.c b/src/voicecall.c
index dc4fdf5..c3fbc7b 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -746,6 +746,16 @@ static void voicecall_emit_multiparty(struct voicecall *call, gboolean mpty)
&val);
}
+static void emulator_indicator_set_forced(struct ofono_voicecall *vc,
+ const char *name)
+{
+ struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
+ struct ofono_emulator *em;
+
+ em = __ofono_atom_find(OFONO_ATOM_TYPE_EMULATOR_HFP, modem);
+ ofono_emulator_indicator_set_forced(em, name);
+}
+
static void emulator_call_status_cb(struct ofono_atom *atom, void *data)
{
struct ofono_emulator *em = __ofono_atom_get_data(atom);
@@ -1621,6 +1631,8 @@ static DBusMessage *manager_swap_without_accept(DBusConnection *conn,
vc->pending = dbus_message_ref(msg);
+ emulator_indicator_set_forced(vc, OFONO_EMULATOR_IND_CALLHELD);
+
vc->driver->swap_without_accept(vc, generic_callback, vc);
return NULL;
@@ -1646,6 +1658,8 @@ static DBusMessage *manager_swap_calls(DBusConnection *conn,
vc->pending = dbus_message_ref(msg);
+ emulator_indicator_set_forced(vc, OFONO_EMULATOR_IND_CALLHELD);
+
vc->driver->hold_all_active(vc, generic_callback, vc);
return NULL;
@@ -3080,6 +3094,9 @@ static void emulator_chld_cb(struct ofono_emulator *em,
if (vc->driver->hold_all_active == NULL)
goto fail;
+ ofono_emulator_indicator_set_forced(em,
+ OFONO_EMULATOR_IND_CALLHELD);
+
vc->pending_em = em;
vc->driver->hold_all_active(vc,
emulator_generic_cb, vc);
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 1/4] voicecall: Improve transitions check
2012-03-09 15:26 [PATCH 1/4] voicecall: Improve transitions check =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
` (2 preceding siblings ...)
2012-03-09 15:26 ` [PATCH 4/4] voicecall: Force callheld update after calls swap =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
@ 2012-03-14 2:44 ` Denis Kenzior
3 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2012-03-14 2:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 542 bytes --]
Hi Frédéric,
On 03/09/2012 09:26 AM, Frédéric Danis wrote:
> Indicators should not be updated if:
> - multiple separate calls are active at same time
> - a conf call and a call are active at same time
> - multiple separate calls are held at same time
> - a conf call and a call are held at same time
> - a conf call has call in active and held state
> ---
> src/voicecall.c | 29 +++++++++++++++++------------
> 1 files changed, 17 insertions(+), 12 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 7+ messages in thread