Skip to content
Commit ea41a24d authored by Jonathan Rico's avatar Jonathan Rico Committed by Carles Cufí
Browse files

Bluetooth: tests: fix double-registering of callbacks



This was the source of assert failures.
If only they were enabled in the first place...

The issue is that in order to save on build time, these two tests build
only one image, from which two devices are
instantiated (`gatt_client_test.c` and `gatt_server_test.c`).

The double-registration happens as `BT_CONN_CB_DEFINE()` is build-time, and
is included in two files of the same image. Then _both_ images will end up
with both `connected()` `disconnected()` etc callbacks, which have logic
specific to their respective images/devices.

The patch uses runtime registration instead so each device only ever
registers its own callbacks and not the other device's too.

Signed-off-by: default avatarJonathan Rico <jonathan.rico@nordicsemi.no>
parent 1b4844aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment