Re: [Zephyr-devel] Is it allowed to use public Bluetooth device address instead of non-resolvable random device address in the project of /sample/bluetooth/mesh_deom?


Johan Hedberg
 

I forgot to mention that if this is for Mesh, you'd take the new option
into use with something like the following:

--- a/subsys/bluetooth/host/mesh/adv.c
+++ b/subsys/bluetooth/host/mesh/adv.c
@@ -115,7 +115,7 @@ static inline void adv_send(struct net_buf *buf)
ad.data_len = buf->len;
ad.data = buf->data;

- param.options = 0;
+ param.options = BT_LE_ADV_OPT_USE_IDENTITY;
param.interval_min = ADV_SCAN_UNIT(adv_int);
param.interval_max = param.interval_min;
param.own_addr = NULL;

Johan

On Tue, Mar 20, 2018, Johan Hedberg wrote:
Hi Kai,

Here's a completely untested pull request which adds the new flag:

https://github.com/zephyrproject-rtos/zephyr/pull/6720

Could you try it out and let me know if it works for you?

Johan

On Tue, Mar 20, 2018, Kai Ren wrote:
Hi Johan,

The reason I want to use static address is that it will be easy to distinguish on Bluetooth packet sniffer. Currently, if there is a Bluetooth noisy background, it's hard to trace the mesh node I'm interested in, so many adv packets pop up on packet sniffer user inferface.

If there will be a flag to enable/disable it, it would be awesome.


Regards,
Kai




On 20/03/2018, 9:53 PM, "Johan Hedberg" <johan.hedberg@intel.com> wrote:

Hi Kai,

Currently the stack will always use a non-resolvable private address
when doing non-connectable advertising, regardless of what kind of
privacy features are supported or not. You can see the logic related to
this in the else-branch of the bt_le_adv_start() function in hci_core.c
that starts on line 4728 (in the current master branch).

So far there hasn't been a need to use anything else with
non-connectable advertising, however if there's a good use case for this
we could e.g. add a new option flag to bt_le_adv_param to force using
the local identity address for advertising (I think that's what you
meant instead of public address since e.g. nRF5x targets will use a
static random identity address by default).

Johan

On Tue, Mar 20, 2018, Kai Ren wrote:
> Hi Vikrant,
>
> Thanks for the reply.
>
> I tested it today, but the device address is still random. Do I need to some extra configuration for it?
>
> ________________________________
> From: Vikrant More <vikrant8051@gmail.com>
> Sent: Monday, March 19, 2018 11:09:07 AM
> To: Kai Ren; zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
> Subject: Re: [Zephyr-devel] Is it allowed to use public Bluetooth device address instead of non-resolvable random device address in the project of /sample/bluetooth/mesh_deom?
>
> Hi Kai,
>
> In proj.conf, you can edit following config option as
>
> CONFIG_BT_PRIVACY=n.
>
> Thanks,
> vikrant8051
>
>
>
>
> On Mon, Mar 19, 2018, 8:16 AM Kai Ren <kren@bluetooth.com<mailto:kren@bluetooth.com>> wrote:
>
> Hello,
>
> I’m using micro:bit to run /sample/bluetooth/mesh_demo/, I found that it use non-resolvable random device address, I’d like to make it use public Bluetooth device address (it’s easy to distinguish on Bluetooth packet sniffer), it is allowed to do? How can I configure it in the ./mesh_demo/ project?
>
> Thanks.
>
>
>
> Regards,
>
> Kai
>
>
>
> _______________________________________________
> Zephyr-devel mailing list
> Zephyr-devel@lists.zephyrproject.org<mailto:Zephyr-devel@lists.zephyrproject.org>
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

> _______________________________________________
> Zephyr-devel mailing list
> Zephyr-devel@lists.zephyrproject.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Join users@lists.zephyrproject.org to automatically receive all group messages.