All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 4/8] handsfree-audio: Implement ofono_handsfree_card_select_codec()
Date: Tue, 09 Apr 2013 20:49:28 -0500	[thread overview]
Message-ID: <5164C528.9050505@gmail.com> (raw)
In-Reply-To: <1365540343-8394-5-git-send-email-vinicius.gomes@openbossa.org>

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

Hi Vinicius,

On 04/09/2013 03:45 PM, Vinicius Costa Gomes wrote:
> ---
>   src/handsfree-audio.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
> index 50be691..12d49db 100644
> --- a/src/handsfree-audio.c
> +++ b/src/handsfree-audio.c
> @@ -49,6 +49,7 @@ struct ofono_handsfree_card {
>   	char *local;
>   	char *path;
>   	DBusMessage *msg;
> +	unsigned char selected_codec;
>   	const struct ofono_handsfree_card_driver *driver;
>   	void *driver_data;
>   };
> @@ -535,6 +536,17 @@ void ofono_handsfree_card_remove(struct ofono_handsfree_card *card)
>   	g_free(card);
>   }
>
> +int ofono_handsfree_card_select_codec(struct ofono_handsfree_card *card,
> +							unsigned char codec)
> +{

Actually make this return void.  If the driver is trying to operate on 
an invalid object then the driver is bugged and I want it to crash 
early, not later.

> +	if (card == NULL)
> +		return -EINVAL;
> +
> +	card->selected_codec = codec;
> +
> +	return 0;
> +}
> +
>   ofono_bool_t ofono_handsfree_audio_has_wideband(void)
>   {
>   	return has_wideband;

Regards,
-Denis

  reply	other threads:[~2013-04-10  1:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 20:45 [PATCH 0/8] HFP 1.6 codec selection Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 1/8] hfpmodem: Add codec watcher register Vinicius Costa Gomes
2013-04-10  1:44   ` Denis Kenzior
2013-04-10 19:31     ` Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 2/8] hfp_hf_bluez5: Register codec watcher Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 3/8] include: ofono_handsfree_card_select_codec() Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 4/8] handsfree-audio: Implement ofono_handsfree_card_select_codec() Vinicius Costa Gomes
2013-04-10  1:49   ` Denis Kenzior [this message]
2013-04-09 20:45 ` [PATCH 5/8] hfp_hf_bluez5: Set the audio codec in the card Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 6/8] handsfree-audio: Send the selected codec Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 7/8] handsfree-audio: Set CVSD as default in the card Vinicius Costa Gomes
2013-04-09 20:45 ` [PATCH 8/8] handsfree-audio: Enable wideband speech if defer is enabled Vinicius Costa Gomes

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=5164C528.9050505@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.