From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH_v3 2/4] android/pan: Listen for incoming connections and accept in NAP role
Date: Wed, 08 Jan 2014 11:34:29 +0200 [thread overview]
Message-ID: <52CD1BA5.1060801@linux.intel.com> (raw)
In-Reply-To: <CABBYNZJHnUd9z6SRt84=OCXueBru9f5ae_m2SR06ujJzjQidBQ@mail.gmail.com>
Hi Luiz,
On 01/08/2014 11:07 AM, Luiz Augusto von Dentz wrote:
> Hi Ravi,
>
> On Tue, Jan 7, 2014 at 2:31 PM, Ravi kumar Veeramally
> <ravikumar.veeramally@linux.intel.com> wrote:
>> Listen for incoming connections and accept it. Create bnep interface
>> add it to bridge and notify control and connection state information
>> through HAL. Remove the device on disconnect request. If android
>> settings UI does not have bluetooth tethering enabled it immediately
>> sends disconnect signal.
>> ---
>> android/pan.c | 192 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 190 insertions(+), 2 deletions(-)
>>
>> diff --git a/android/pan.c b/android/pan.c
>> index 93078ba..0eef284 100644
>> --- a/android/pan.c
>> +++ b/android/pan.c
>> @@ -63,12 +63,17 @@ struct pan_device {
>> uint8_t role;
>> GIOChannel *io;
>> struct bnep *session;
>> + guint watch;
>> };
>>
>> static struct {
>> uint32_t record_id;
>> + guint watch;
>> + GIOChannel *io;
>> } nap_dev = {
>> .record_id = 0,
>> + .watch = 0,
>> + .io = NULL,
>> };
>>
>> static int device_cmp(gconstpointer s, gconstpointer user_data)
>> @@ -81,13 +86,21 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)
>>
>> static void pan_device_free(struct pan_device *dev)
>> {
>> + if (dev->watch > 0) {
>> + bnep_server_delete(BNEP_BRIDGE, dev->iface, &dev->dst);
>> + g_source_remove(dev->watch);
>> + dev->watch = 0;
> Usually it is not necessary to assign anything to struct members when
> you are freeing the whole struct since its memory gonna be freed
> anyway.
Yes you are right. Profiles/network/connection.c keeps device data
after disconnecting,
it will remove only on device remove call. Assigning zero or NULL
make sense there.
But in bluez-android device struct t is removed from list on
disconnected state.
Here it won't make much sense. I will remove it in my next version.
Thanks,
Ravi.
next prev parent reply other threads:[~2014-01-08 9:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 12:31 [PATCH_v3 0/4] Add support for NAP role Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 1/4] android/pan: Register Network Access Point Ravi kumar Veeramally
2014-01-08 9:18 ` Szymon Janc
2014-01-08 9:27 ` Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 2/4] android/pan: Listen for incoming connections and accept in NAP role Ravi kumar Veeramally
2014-01-08 9:07 ` Luiz Augusto von Dentz
2014-01-08 9:34 ` Ravi kumar Veeramally [this message]
2014-01-07 12:31 ` [PATCH_v3 3/4] android/pan: Implement PAN enable HAL api at daemon side Ravi kumar Veeramally
2014-01-08 9:24 ` Szymon Janc
2014-01-08 9:29 ` Ravi kumar Veeramally
2014-01-07 12:31 ` [PATCH_v3 4/4] android/pan: Remove connected PAN devices on profile unregister call Ravi kumar Veeramally
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=52CD1BA5.1060801@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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.