Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 22/27] stkutil: Add Set Up Call response builder.
Date: Tue, 25 May 2010 16:38:41 -0500	[thread overview]
Message-ID: <201005251638.41692.denkenz@gmail.com> (raw)
In-Reply-To: <1274018858-6968-1-git-send-email-andrew.zaborowski@intel.com>

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

Hi Andrew,

> ---
>  src/stkutil.c |   33 +++++++++++++++++++++++++++++++++
>  src/stkutil.h |    9 +++++++++
>  2 files changed, 42 insertions(+), 0 deletions(-)
> 
> diff --git a/src/stkutil.c b/src/stkutil.c
> index cf22361..4e813ec 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -3129,6 +3129,20 @@ static gboolean build_dataobj_text(struct
>  stk_tlv_builder *tlv, return stk_tlv_close_container(tlv);
>  }
> 
> +/* Described in TS 102.223 Section 8.30 */
> +static gboolean build_dataobj_cc_requested_action(struct stk_tlv_builder
>  *tlv, +					const void *data, gboolean cr)
> +{
> +	const struct stk_common_byte_array *action = data;
> +
> +	return action->array == NULL ||
> +		(stk_tlv_open_container(tlv, cr,
> +			STK_DATA_OBJECT_TYPE_CALL_CONTROL_REQUESTED_ACTION,
> +			FALSE) &&
> +		 stk_tlv_append_bytes(tlv, action->array, action->len) &&
> +		 stk_tlv_close_container(tlv));
> +}
> +

I really don't like this style, at the very least break up the tag into a 
variable so it is one open/append/close per line.  See how I did the others.

>  static gboolean build_dataobj(struct stk_tlv_builder *tlv, gboolean
>  				(*builder_func)(struct stk_tlv_builder *,
>  						const void *, gboolean), ...)
> @@ -3231,6 +3245,25 @@ unsigned int stk_pdu_from_response(const struct
>  stk_response *response, &response->select_item.item_id,
>  					NULL);
>  		break;
> +	case STK_COMMAND_TYPE_SETUP_CALL:
> +		if (response->set_up_call.modified_result.cc_modified)
> +			ok = build_dataobj(&builder,
> +					build_dataobj_cc_requested_action,
> +					DATAOBJ_FLAG_CR,
> +					&response->set_up_call.
> +					 cc_requested_action,
> +					build_dataobj_result, DATAOBJ_FLAG_CR,
> +					&response->set_up_call.modified_result.
> +					 result,
> +					NULL);
> +		else
> +			ok = build_dataobj(&builder,
> +					build_dataobj_cc_requested_action,
> +					DATAOBJ_FLAG_CR,
> +					&response->set_up_call.
> +					 cc_requested_action,
> +					NULL);
> +		break;

This really should be in a separate function, similar to how you did the local 
info.

Regards,
-Denis

      reply	other threads:[~2010-05-25 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-16 14:07 [PATCH 22/27] stkutil: Add Set Up Call response builder Andrzej Zaborowski
2010-05-25 21:38 ` Denis Kenzior [this message]

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=201005251638.41692.denkenz@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