Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] voicecall: add +VTS support for HFP emulator
Date: Thu, 19 May 2011 11:42:29 -0500	[thread overview]
Message-ID: <4DD54875.1010100@gmail.com> (raw)
In-Reply-To: <1305540829-14417-1-git-send-email-frederic.dalleau@linux.intel.com>

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

Hi Frédéric,

> +static void emulator_vts_cb(struct ofono_emulator *em,
> +			struct ofono_emulator_request *req, void *userdata)
> +{
> +	struct ofono_voicecall *vc = userdata;
> +	struct ofono_error result;
> +	const char *str;
> +
> +	switch (ofono_emulator_request_get_type(req)) {
> +	case OFONO_EMULATOR_REQUEST_TYPE_SET:
> +		str = ofono_emulator_request_get_raw(req);
> +
> +		if (__ofono_voicecall_tone_send(vc, str, vts_tone_cb, em) < 0)
> +			break;

This looks wrong.  The VTS command takes a single ascii character, not a
string.  So you need to validate that.  +VTS also does not accept P/p
characters, so you need to make sure to filter these out as well.

> +
> +		return;
> +
> +	default:
> +		break;
> +	}
> +

I'd do this like this:

if (__tone_send() == 0)
	return;

> +	result.error = 0;
> +	result.type = OFONO_ERROR_TYPE_FAILURE;
> +
> +	ofono_emulator_send_final(em, &result);
> +}
> +

Regards,
-Denis

      reply	other threads:[~2011-05-19 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 10:13 [PATCH] voicecall: add +VTS support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-19 16:42 ` 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=4DD54875.1010100@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