diff --git a/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_client_test.c b/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_client_test.c index 9c60c5b57b2..d276bfcedc3 100644 --- a/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_client_test.c +++ b/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_client_test.c @@ -60,7 +60,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) UNSET_FLAG(flag_is_connected); } -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, }; @@ -297,6 +297,8 @@ static void test_main(void) { int err; + bt_conn_cb_register(&conn_callbacks); + err = bt_enable(NULL); if (err != 0) { FAIL("Bluetooth discover failed (err %d)\n", err); diff --git a/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_server_test.c b/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_server_test.c index 03942821640..a09b94367fb 100644 --- a/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_server_test.c +++ b/tests/bsim/bluetooth/host/gatt/authorization/src/gatt_server_test.c @@ -45,7 +45,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) g_conn = NULL; } -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, }; @@ -331,6 +331,8 @@ static void test_main(void) return; } + bt_conn_cb_register(&conn_callbacks); + err = bt_enable(NULL); if (err != 0) { FAIL("Bluetooth init failed (err %d)\n", err); diff --git a/tests/bsim/bluetooth/host/gatt/general/src/gatt_client_test.c b/tests/bsim/bluetooth/host/gatt/general/src/gatt_client_test.c index 0ae87791f81..cc233510b0b 100644 --- a/tests/bsim/bluetooth/host/gatt/general/src/gatt_client_test.c +++ b/tests/bsim/bluetooth/host/gatt/general/src/gatt_client_test.c @@ -74,7 +74,7 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ } } -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, .security_changed = security_changed, @@ -351,6 +351,8 @@ static void test_main(void) { int err; + bt_conn_cb_register(&conn_callbacks); + err = bt_enable(NULL); if (err != 0) { FAIL("Bluetooth discover failed (err %d)\n", err); diff --git a/tests/bsim/bluetooth/host/gatt/general/src/gatt_server_test.c b/tests/bsim/bluetooth/host/gatt/general/src/gatt_server_test.c index e41d568dff8..c77fe39c000 100644 --- a/tests/bsim/bluetooth/host/gatt/general/src/gatt_server_test.c +++ b/tests/bsim/bluetooth/host/gatt/general/src/gatt_server_test.c @@ -47,7 +47,7 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) UNSET_FLAG(flag_is_connected); } -BT_CONN_CB_DEFINE(conn_callbacks) = { +static struct bt_conn_cb conn_callbacks = { .connected = connected, .disconnected = disconnected, }; @@ -151,6 +151,8 @@ static void test_main(void) BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)) }; + bt_conn_cb_register(&conn_callbacks); + err = bt_enable(NULL); if (err != 0) { FAIL("Bluetooth init failed (err %d)\n", err);