Re: Disabling Relay feature of a node of bluetooth mesh

Johan Hedberg

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) {

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.


Join to automatically receive all group messages.