When using nRF MESH, two BLE event handlers being called


I have set a Mesh Client Node with two BLE services: Mesh Proxy Service and Nordic Uart Service. 

The problem is that when I send a message to the Mesh Client  from nRF Mesh app (for example, binding the Appkey, or the setting the publication address), two "on_ble_evt" handlers are being called: "mesh_gatt_on_ble_evt" (which is correct) but also "ble_nus_on_ble_evt", so the NUS service interprets the incoming packet as a NUS packet, while it is a packet for the Mesh service. 

¿Any idea of why this is happening?

Thank you

  • Due to the Easter holiday, response time can be slower than usual. Sorry for any inconvenience caused by this! It seems that both functions interpret the smartphone message as a regular BLE event, even if you are sending to the mesh proxy service characteristic.

    One of our application engineers has made an example combining the light switch example with the nordic uart example like you have done. Having looked at his code, it seems that he has one ble event handler. This makes sense, as both mesh_gatt_on_ble_evt() from the mesh example & ble_nus_on_ble_evt() from Nordic UART service do look very similar (i.e. they have the same function parameters).

    This documentation may also be helpful if you have not seen it yet.