Re: Disabling Relay feature of a node of bluetooth mesh


ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi Johan,

>There's something not matching up with the description of your
configuration however.
>You said that NODE1 has both Relay and GATT Proxy
states disabled

for NODE1, Proxy is enabled. This explains relaying of messages over advertising. 



--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 8, 2017 at 2:51 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Ashish,

On Fri, Dec 08, 2017, Johan Hedberg wrote:
> On Fri, Dec 08, 2017, ashish.shukla@... wrote:
> > NODE1 does receives the messages and process it. But it relay/forward the
> > same message to network by reducing TTL value by 1.
> >
> > In my case, GATT client is mobile phone so it isn't possible to know
> > whether it receives something or not, for now.
> >
> > I'm attaching snapshot of terminal of NODE1, when it receives messages from
> > NODE2 on pressing the button.
>
> Are you concluding that the relaying happens because you see the
> "Relaying packet" log message? If so, then that's a wrong assumption,
> and the log message is indeed misleading. Please take a look at the
> bt_mesh_net_relay() function in net.c. You'll see that the log message
> is printed as soon as some basic checks are passed, but that does not
> mean that bt_mesh_adv_send() at the end of the function will get called,
> since that's still behind the relay_to_adv() check.

There's something not matching up with the description of your
configuration however. You said that NODE1 has both Relay and GATT Proxy
states disabled, however bt_mesh_net_relay() has the following test
before printing the log message that could be seen on your console:

        if (rx->net_if == BT_MESH_NET_IF_ADV &&
            bt_mesh_relay_get() != BT_MESH_RELAY_ENABLED &&
            bt_mesh_gatt_proxy_get() != BT_MESH_GATT_PROXY_ENABLED) {
                return;
        }

So the function should bail out at this point for any packet received
over advertising when neither Relay nor GATT Proxy is set to enabled.
Your logs show that the packet was received over net_if 0, which is
BT_MESH_NET_IF_ADV, so based on the fact that the code continued from
this point it seems you had either Relay or GATT Proxy enabled.

Johan

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