All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org, johan.hedberg@gmail.com
Subject: Re: [PATCH 1/4] android/pan: Register Network Access Point
Date: Tue, 07 Jan 2014 11:57:39 +0200	[thread overview]
Message-ID: <52CBCF93.7060604@linux.intel.com> (raw)
In-Reply-To: <20140107085930.GB9155@x220.p-661hnu-f1>

Hi Johan,

On 01/07/2014 10:59 AM, Johan Hedberg wrote:
> Hi Ravi,
>
> On Mon, Jan 06, 2014, Ravi kumar Veeramally wrote:
>> Register NAP server and adds bnep bridge. Removes bridge
>> on destroy call. Bridge mechanism is needed when device acting
>> as a server and listen for incoming connections.
>> ---
>>   android/pan.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>>   1 file changed, 112 insertions(+), 4 deletions(-)
>>
>> diff --git a/android/pan.c b/android/pan.c
>> index 38e353d..93f712f 100644
>> --- a/android/pan.c
>> +++ b/android/pan.c
>> @@ -28,6 +28,11 @@
>>   #include <unistd.h>
>>   #include <fcntl.h>
>>   #include <glib.h>
>> +#include <sys/ioctl.h>
>> +#include <sys/socket.h>
>> +#include <sys/wait.h>
>> +#include <net/if.h>
>> +#include <linux/sockios.h>
>>   
>>   #include "btio/btio.h"
>>   #include "lib/bluetooth.h"
>> @@ -49,7 +54,7 @@
>>   static bdaddr_t adapter_addr;
>>   GSList *devices = NULL;
>>   uint8_t local_role = HAL_PAN_ROLE_NONE;
>> -static uint32_t record_id = 0;
>> +char bridge[5] = "bnep\0";
> This last line raises several questions. Firstly, C-strings have an
> implicit nul-character at the end so no need to explicitly try to add
> one there. You also don't need to have an explicit size between the
> square brackets since this is automatically calculated if you do
> initialization upon declaration. Why isn't this static? Why isn't it
> const? Would a simple define make more sense instead of a dedicated
> variable?

  I tried these but there are some warnings.

#define BNEP_BRIDGE   "bnep"
static char bridge[] = "bnep";
static char *bridge = "bnep";

==10198== Warning: noted but unhandled ioctl 0x89a1 with no 
size/direction hints
==10198==    This could cause spurious value errors to appear.
==10198==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing 
a proper wrapper.

char bridge[5] = "bnep\0"; worked fine (yes, like you said static can be used).

Regards,
Ravi.


  reply	other threads:[~2014-01-07  9:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 21:26 [PATCH 0/4] Add support for NAP role Ravi kumar Veeramally
2014-01-06 21:26 ` [PATCH 1/4] android/pan: Register Network Access Point Ravi kumar Veeramally
2014-01-07  8:59   ` Johan Hedberg
2014-01-07  9:57     ` Ravi kumar Veeramally [this message]
2014-01-07 10:18       ` Johan Hedberg
2014-01-07 10:48         ` Ravi kumar Veeramally
2014-01-06 21:26 ` [PATCH 2/4] android/pan: Listen for incoming connections and accept in NAP role Ravi kumar Veeramally
2014-01-06 21:26 ` [PATCH 3/4] android/pan: Implement PAN enable HAL api at daemon side Ravi kumar Veeramally
2014-01-06 21:26 ` [PATCH 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=52CBCF93.7060604@linux.intel.com \
    --to=ravikumar.veeramally@linux.intel.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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.