This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Double notifications on multilink example with custom service

Hello,

I implemented a firmware based on the multilink central example, with a custom service. I am using NRF52832 (custom board) with SDK v15.2 and Softdevice S132 v6.1.0.

My setup is the following one. I have two peripherals (peripheral 1 and peripheral 2) with the exact same firmware and a custom service. I have a central device with a firmware based on multilink example, with a custom service. The central device connects to the two peripheral devices and should be able to receive data from the two peripherals simultaneously.

The scan, connect and discovery steps seem to be working fine with two peripheral devices. My problem is that, once the notifications are enabled, I received two BLE_GATTC_EVT_HVX events instead of one in my ble_customservice_c_on_ble_evt() function. The prototype of the function is the following one : void ble_customservice_c_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context).
When peripheral 1 sends a data, I get a BLE_GATTC_EVT_HVX event with p_context->conn_handle = 0 and p_ble_evt->evt.gattc_evt.conn_handle = 0. Then I get another BLE_GATTC_EVT_HVX event with the exact same data except for the connection handles, with p_context->conn_handle = 1 and p_ble_evt->evt.gattc_evt.conn_handle = 0.

I have removed the two instances of DB Discovery module to only use one, as it is advised in this topic : https://devzone.nordicsemi.com/f/nordic-q-a/27126/sdk14-nus-multilink-issue. But the result is the same.
I have seen a solution which is to ignore the frames when the two connection handles are not equal, but this solution does not seem satisfying for our purpose as we have frequency objectives and we cannot meet them with the current implementation.

Is it normal to receive 2 notifications instead of one when the central is connected to two peripherals ? Is there a way to fix this problem ?

If you need any information to understand the problem, please let me know.

Thank you.

Parents Reply Children
No Data
Related