All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v0 03/10] handsfree-audio: Remove modem dependency
Date: Fri, 01 Mar 2013 13:29:47 -0600	[thread overview]
Message-ID: <513101AB.4070801@gmail.com> (raw)
In-Reply-To: <1362077572-28049-4-git-send-email-claudio.takahasi@openbossa.org>

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

Hi Claudio,

On 02/28/2013 12:52 PM, Claudio Takahasi wrote:
> This patch replaces the handsfree modem verification by the Audio Card.
> Audio Cards are created when the RFCOMM fd descriptor is received, and
> registered when the service level connetion is established.
> ---
>   src/handsfree-audio.c | 19 ++++++-------------
>   1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
> index 14488ac..6657bc5 100644
> --- a/src/handsfree-audio.c
> +++ b/src/handsfree-audio.c
> @@ -70,19 +70,12 @@ static GSList *card_list = 0;
>   static guint sco_watch = 0;
>   static uint16_t local_hfp_version = HFP_VERSION_1_6;
>
> -static ofono_bool_t slc_match(struct ofono_modem *modem, void *userdata)
> +static int card_cmp(gconstpointer a, gconstpointer b)
>   {
> -	const char *remote = userdata;
> -	const char *value = ofono_modem_get_string(modem, "Remote");
> +	const struct ofono_handsfree_card *card = a;
> +	const char *remote = b;
>
> -	if (value == NULL)
> -		return FALSE;
> -
> -	/* Make sure SLC has been established */
> -	if (ofono_modem_get_powered(modem) != TRUE)
> -		return FALSE;
> -
> -	return g_str_equal(remote, value);
> +	return g_strcmp0(card->remote, remote);
>   }
>
>   static gboolean sco_accept(GIOChannel *io, GIOCondition cond,
> @@ -107,8 +100,8 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition cond,
>
>   	bt_ba2str(&saddr.sco_bdaddr, remote);
>
> -	if (ofono_modem_find(slc_match, remote) == NULL) {
> -		ofono_error("Rejecting SCO: No SLC connection found!");
> +	if (g_slist_find_custom(card_list, remote, card_cmp) == NULL) {
> +		ofono_error("Rejecting SCO: Audio Card not found!");
>   		close(nsk);
>   		return TRUE;
>   	}

Please don't do it this way, I do not want to introduce irrelevant code 
just to remove it right away.  Merge this patch into the previous one or 
cut down the first patch to just the bare necessities.

Regards,
-Denis

  reply	other threads:[~2013-03-01 19:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 18:52 [PATCH v0 00/10] handsfree-audio: Add Agent NewConnection() Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 01/10] bluetooth: Add new Bluetooth header Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 02/10] handsfree-audio: Move SCO to handsfree-audio.c Claudio Takahasi
2013-03-01 19:20   ` Denis Kenzior
2013-03-04 15:44     ` Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 03/10] handsfree-audio: Remove modem dependency Claudio Takahasi
2013-03-01 19:29   ` Denis Kenzior [this message]
2013-03-04 15:45     ` Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 04/10] handsfree-audio: Add NewConnection Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 05/10] handsfree-audio: Check local SCO address Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 06/10] handsfree-audio: Reject SCO if Card is not ready Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 07/10] handsfree-audio: Reject SCO if agent is unavailable Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 08/10] handsfree-audio: Check CVSD when registering agent Claudio Takahasi
2013-03-01 19:32   ` Denis Kenzior
2013-02-28 18:52 ` [PATCH v0 09/10] handsfree-audio: Add function to get hfp version Claudio Takahasi
2013-03-01 19:40   ` Denis Kenzior
2013-03-04 16:02     ` Claudio Takahasi
2013-03-04 18:04       ` Denis Kenzior
2013-03-04 19:24         ` Marcel Holtmann
2013-03-04 19:30           ` Denis Kenzior
2013-03-04 19:54             ` Claudio Takahasi
2013-02-28 18:52 ` [PATCH v0 10/10] hfp_hf_bluez5: Fix hard-coded " Claudio Takahasi
2013-03-04 20:48 ` [PATCH v1 0/6] handsfree-audio: Add Agent NewConnection() Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 1/6] bluetooth: Add new Bluetooth header Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 2/6] handsfree-audio: Move SCO to handsfree-audio.c Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 3/6] handsfree-audio: Add NewConnection Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 4/6] handsfree-audio: Check local SCO address Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 5/6] handsfree-audio: Reject SCO if Card is not ready Claudio Takahasi
2013-03-04 20:48   ` [PATCH v1 6/6] handsfree-audio: Reject SCO if agent is unavailable Claudio Takahasi
2013-03-04 22:44   ` [PATCH v1 0/6] handsfree-audio: Add Agent NewConnection() Denis Kenzior
2013-03-05 16:40     ` Claudio Takahasi
2013-03-05 20:38       ` 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=513101AB.4070801@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.