Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 8/9] call-forwarding: Watch for changes to relevant SIM files.
Date: Thu, 17 Feb 2011 14:57:33 -0600	[thread overview]
Message-ID: <4D5D8BBD.9090207@gmail.com> (raw)
In-Reply-To: <1297756739-2958-8-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]

Hi Andrew,

On 02/15/2011 01:58 AM, Andrzej Zaborowski wrote:
> ---
>  src/call-forwarding.c |   39 +++++++++++++++++++++++++++++++++++++--
>  1 files changed, 37 insertions(+), 2 deletions(-)
> 
> diff --git a/src/call-forwarding.c b/src/call-forwarding.c
> index d13f990..d610521 100644
> --- a/src/call-forwarding.c
> +++ b/src/call-forwarding.c
> @@ -74,6 +74,7 @@ static void get_query_next_cf_cond(struct ofono_call_forwarding *cf);
>  static void set_query_next_cf_cond(struct ofono_call_forwarding *cf);
>  static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf);
>  static void cf_unregister_ss_controls(struct ofono_call_forwarding *cf);
> +static void sim_read_cf_indicator(struct ofono_call_forwarding *cf);
>  
>  struct cf_ss_request {
>  	int ss_type;
> @@ -1358,18 +1359,52 @@ static void sim_cphs_cff_read_cb(int ok, int total_length, int record,
>  					DBUS_TYPE_BOOLEAN, &cfu_voice);
>  }
>  
> +static void sim_cfis_changed(int id, void *userdata)
> +{
> +	struct ofono_call_forwarding *cf = userdata;
> +
> +	if (((cf->flags & CALL_FORWARDING_FLAG_CPHS_CFF) ||
> +			cf->cfis_record_id > 0) && is_cfu_enabled(cf, NULL)) {
> +		DBusConnection *conn = ofono_dbus_get_connection();
> +		const char *path = __ofono_atom_get_path(cf->atom);
> +		ofono_bool_t status = FALSE;
> +
> +		ofono_dbus_signal_property_changed(conn, path,
> +					OFONO_CALL_FORWARDING_INTERFACE,
> +					"ForwardingFlagOnSim",
> +					DBUS_TYPE_BOOLEAN, &status);
> +	}
> +
> +	cf->cfis_record_id = 0;
> +	cf->flags &= ~CALL_FORWARDING_FLAG_CPHS_CFF;
> +
> +	/*
> +	 * TODO: remove forwarding rules in
> +	 * cf->cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] that
> +	 * originate from EFcfis before adding the new rules?
> +	 */
> +
> +	sim_read_cf_indicator(cf);

Wouldn't this result in us adding a 2nd, or 3rd, or 4th, etc file watch
here?

> +}
> +
>  static void sim_read_cf_indicator(struct ofono_call_forwarding *cf)
>  {
>  	if (__ofono_sim_service_available(cf->sim,
>  			SIM_UST_SERVICE_CFIS,
> -			SIM_SST_SERVICE_CFIS) == TRUE)
> +			SIM_SST_SERVICE_CFIS) == TRUE) {
>  		ofono_sim_read(cf->sim_context, SIM_EFCFIS_FILEID,
>  				OFONO_SIM_FILE_STRUCTURE_FIXED,
>  				sim_cfis_read_cb, cf);
> -	else
> +		ofono_sim_add_file_watch(cf->sim_context, SIM_EFCFIS_FILEID,
> +						sim_cfis_changed, cf, NULL);
> +	} else {
>  		ofono_sim_read(cf->sim_context, SIM_EF_CPHS_CFF_FILEID,
>  				OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
>  				sim_cphs_cff_read_cb, cf);
> +		ofono_sim_add_file_watch(cf->sim_context,
> +						SIM_EF_CPHS_CFF_FILEID,
> +						sim_cfis_changed, cf, NULL);
> +	}
>  }
>  
>  int ofono_call_forwarding_driver_register(const struct ofono_call_forwarding_driver *d)

Regards,
-Denis

  reply	other threads:[~2011-02-17 20:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15  7:58 [PATCH 1/9] modem.c: Go to PRE_SIM modem state on OFONO_SIM_STATE_INSERTED Andrzej Zaborowski
2011-02-15  7:58 ` [PATCH 2/9] sim: Implement basic Refresh Andrzej Zaborowski
2011-02-17 21:03   ` Denis Kenzior
2011-02-19  4:18     ` Andrzej Zaborowski
2011-02-15  7:58 ` [PATCH 3/9] sim: Watch for changes to relevant SIM files Andrzej Zaborowski
2011-02-17 21:08   ` Denis Kenzior
2011-02-19  4:24     ` Andrzej Zaborowski
2011-02-15  7:58 ` [PATCH 4/9] voicecall: " Andrzej Zaborowski
2011-02-17 21:08   ` Denis Kenzior
2011-02-15  7:58 ` [PATCH 5/9] network: " Andrzej Zaborowski
2011-02-17 21:09   ` Denis Kenzior
2011-02-15  7:58 ` [PATCH 6/9] cbs: " Andrzej Zaborowski
2011-02-17 21:10   ` Denis Kenzior
2011-02-15  7:58 ` [PATCH 7/9] message-waiting: " Andrzej Zaborowski
2011-02-17 20:54   ` Denis Kenzior
2011-02-15  7:58 ` [PATCH 8/9] call-forwarding: " Andrzej Zaborowski
2011-02-17 20:57   ` Denis Kenzior [this message]
2011-02-15  7:58 ` [PATCH 9/9] stk: Partially handle Refresh command Andrzej Zaborowski
2011-02-17 21:17   ` Denis Kenzior
2011-02-17 21:00 ` [PATCH 1/9] modem.c: Go to PRE_SIM modem state on OFONO_SIM_STATE_INSERTED 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=4D5D8BBD.9090207@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox