All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v1 1/6] hfp_hf_bluez5: Add registering Audio Card
Date: Wed, 27 Feb 2013 14:49:18 -0600	[thread overview]
Message-ID: <512E714E.3050301@gmail.com> (raw)
In-Reply-To: <1361997234-13804-2-git-send-email-claudio.takahasi@openbossa.org>

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

Hi Claudio,

On 02/27/2013 02:33 PM, Claudio Takahasi wrote:
> This patch registers the Handsfree Audio Card when the service level
> connection is established.
> ---
>   plugins/hfp_hf_bluez5.c | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
> index 7057d71..436d98c 100644
> --- a/plugins/hfp_hf_bluez5.c
> +++ b/plugins/hfp_hf_bluez5.c
> @@ -46,6 +46,7 @@
>   #include<ofono/netreg.h>
>   #include<ofono/voicecall.h>
>   #include<ofono/call-volume.h>
> +#include<ofono/handsfree-audio.h>
>   #include<ofono/handsfree.h>
>
>   #include<drivers/hfpmodem/slc.h>
> @@ -61,6 +62,7 @@
>   struct hfp {
>   	struct hfp_slc_info info;
>   	DBusMessage *msg;
> +	struct ofono_handsfree_card *card;
>   };
>
>   static GDBusClient *bluez = NULL;
> @@ -88,6 +90,8 @@ static void slc_established(gpointer userdata)
>   	hfp->msg = NULL;
>
>   	ofono_info("Service level connection established");
> +
> +	ofono_handsfree_card_register(hfp->card);
>   }
>
>   static void slc_failed(gpointer userdata)
> @@ -315,8 +319,11 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
>   {
>   	struct hfp *hfp;
>   	struct ofono_modem *modem;
> +	struct sockaddr_rc saddr;
> +	socklen_t optlen;
>   	DBusMessageIter entry;
>   	const char *device;
> +	char remote[18];
>   	int fd, err;
>
>   	DBG("Profile handler NewConnection");
> @@ -353,8 +360,20 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
>   					"Not enough resources");
>   	}
>
> +	memset(&saddr, 0, sizeof(saddr));
> +	optlen = sizeof(saddr);
> +	if (getpeername(fd, (struct sockaddr *)&saddr,&optlen)<  0) {

Please fix this according to doc/coding-style.txt Item M1 1)

> +		err = errno;
> +		ofono_error("RFCOMM getpeername(): %s (%d)", strerror(err), err);

This part seems to be over 80 characters

> +		close(fd);
> +		goto invalid;
> +	}
> +
> +	bt_ba2str(&saddr.rc_bdaddr, remote);
> +
>   	hfp = ofono_modem_get_data(modem);
>   	hfp->msg = dbus_message_ref(msg);
> +	hfp->card = ofono_handsfree_card_create(remote, NULL);
>
>   	return NULL;
>

Regards,
-Denis

  reply	other threads:[~2013-02-27 20:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 17:58 [PATCH v0 0/7] hfp_hf_bluez5: Register Audio Cards in handsfree manager Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 1/7] handsfree-audio: Switch argument order when creating card Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 2/7] hfp_hf_bluez5: Add registering Audio Card Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 3/7] hfp_hf_bluez5: Add local Bluetooth address to " Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 4/7] hfp_hf_bluez5: Remove Audio Card when SLC fails Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 5/7] hfp_hf_bluez5: Remove Audio Card when SLC is disconnected Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 6/7] hfp_hf_bluez5: Remove Audio Card when modem is disabled Claudio Takahasi
2013-02-27 17:58 ` [PATCH v0 7/7] hfp_hf_bluez5: Remove Audio Card when disconnection is requested Claudio Takahasi
2013-02-27 20:33 ` [PATCH v1 0/6] hfp_hf_bluez5: Register Audio Cards in handsfree manager Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 1/6] hfp_hf_bluez5: Add registering Audio Card Claudio Takahasi
2013-02-27 20:49     ` Denis Kenzior [this message]
2013-02-27 21:03     ` [PATCH v2 " Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 2/6] hfp_hf_bluez5: Add local Bluetooth address to " Claudio Takahasi
2013-02-27 21:02     ` [PATCH v2 " Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 3/6] hfp_hf_bluez5: Remove Audio Card when SLC fails Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 4/6] hfp_hf_bluez5: Remove Audio Card when SLC is disconnected Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 5/6] hfp_hf_bluez5: Remove Audio Card when modem is disabled Claudio Takahasi
2013-02-27 20:33   ` [PATCH v1 6/6] hfp_hf_bluez5: Remove Audio Card when disconnection is requested Claudio Takahasi
2013-02-28 16:00   ` [PATCH v3 0/6] hfp_hf_bluez5: Register Audio Cards in handsfree manager Claudio Takahasi
2013-02-28 16:11     ` 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=512E714E.3050301@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.