From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 3/4] emulator: Force indicator event implementation
Date: Tue, 13 Mar 2012 21:47:52 -0500 [thread overview]
Message-ID: <4F6006D8.5090006@gmail.com> (raw)
In-Reply-To: <1331306815-13424-3-git-send-email-frederic.danis@linux.intel.com>
[-- 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
next prev parent reply other threads:[~2012-03-14 2:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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-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
2012-03-14 2:47 ` Denis Kenzior [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F6006D8.5090006@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.