BLE callback when mesh protocol is used

Hello,

Currently, I'm working on a mesh application based on a light sample. and I have two questions

1- is it possible to implement ble callback in the application to catch when Ble device is connected/disconnected with a device for example a smartphone? 

2- if I want to use the benefit of a mesh network ( re-transmit messages between nodes until they reach their destination) do I need to enable the relay feature?

 (actually, here I'm asking that because I'm using LPN nodes around (20) and one central-node. and I would like to get the balance between mesh benefit and power consumption, I think in            case the relay feature is enabled in lpn node, then the power consumption will go high, but here is there a way to make some optimization between power consumption and relay f                       feature.

Platform:

ncs: v2.2.0

cental-node: NRF5340

lpn-node: NRF52840

I really appreciate any help you can provide.

Parents
  • Hi Mustafa,

    1- is it possible to implement ble callback in the application to catch when Ble device is connected/disconnected with a device for example a smartphone? 

    Yes. You can refer to the Mesh and (BLE) Peripheral Coexistence sample. Look for how the connected() function is registered as a callback in lb_service_handler.c.

    2- if I want to use the benefit of a mesh network ( re-transmit messages between nodes until they reach their destination) do I need to enable the relay feature?

    If you need "retransmit messages between nodes until they reach their destination" then yes you need the relay feature. However, 

    in            case the relay feature is enabled in lpn node

    The relay feature don't work on Low-Power Nodes (LPNs). LPNs achieve low-power by going to sleep, only wake up some times and rely on Friend Nodes to tell them what they miss while they were sleeping. When they sleep, they cannot relay any messages. If they don't sleep, I guess they can still perform the Low-Power Node features, but for no benefit.


    I have an inkling that you may be expecting the Bluetooth Mesh can relay normal BLE traffic. Could this be the case? If so, please know that Bluetooth Mesh cannot do that.

    Hieu

Reply
  • Hi Mustafa,

    1- is it possible to implement ble callback in the application to catch when Ble device is connected/disconnected with a device for example a smartphone? 

    Yes. You can refer to the Mesh and (BLE) Peripheral Coexistence sample. Look for how the connected() function is registered as a callback in lb_service_handler.c.

    2- if I want to use the benefit of a mesh network ( re-transmit messages between nodes until they reach their destination) do I need to enable the relay feature?

    If you need "retransmit messages between nodes until they reach their destination" then yes you need the relay feature. However, 

    in            case the relay feature is enabled in lpn node

    The relay feature don't work on Low-Power Nodes (LPNs). LPNs achieve low-power by going to sleep, only wake up some times and rely on Friend Nodes to tell them what they miss while they were sleeping. When they sleep, they cannot relay any messages. If they don't sleep, I guess they can still perform the Low-Power Node features, but for no benefit.


    I have an inkling that you may be expecting the Bluetooth Mesh can relay normal BLE traffic. Could this be the case? If so, please know that Bluetooth Mesh cannot do that.

    Hieu

Children
No Data
Related