1010#include <bm/bluetooth/ble_gq.h>
1111#include <zephyr/sys/util.h>
1212
13+ #include <observers.h>
14+
1315#include "cmock_ble_gattc.h"
1416#include "cmock_ble_gatts.h"
1517
@@ -287,7 +289,7 @@ void test_ble_gq_item_add_req_gatt_read_busy_busy_success(void)
287289 .evt .gatts_evt .conn_handle = CONN_HANDLE_1 ,
288290 };
289291
290- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
292+ ble_evt_send (& ble_evt );
291293
292294 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
293295 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -374,7 +376,7 @@ void test_ble_gq_item_add_req_gatt_write_busy_busy_success(void)
374376 .evt .gatts_evt .conn_handle = CONN_HANDLE_2 ,
375377 };
376378
377- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
379+ ble_evt_send (& ble_evt );
378380
379381 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
380382 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -417,7 +419,7 @@ void test_ble_gq_item_add_req_srv_discovery_busy_busy_success(void)
417419 .evt .gatts_evt .conn_handle = CONN_HANDLE_1 ,
418420 };
419421
420- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
422+ ble_evt_send (& ble_evt );
421423
422424 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
423425 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -458,7 +460,7 @@ void test_ble_gq_item_add_req_char_discovery_busy_busy_success(void)
458460 .evt .gatts_evt .conn_handle = CONN_HANDLE_1 ,
459461 };
460462
461- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
463+ ble_evt_send (& ble_evt );
462464
463465 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
464466 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -499,7 +501,7 @@ void test_ble_gq_item_add_req_desc_discovery_busy_busy_success(void)
499501 .evt .gatts_evt .conn_handle = CONN_HANDLE_1 ,
500502 };
501503
502- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
504+ ble_evt_send (& ble_evt );
503505
504506 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
505507 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -535,7 +537,7 @@ void test_ble_gq_item_add_req_gatts_hvx_busy_busy_success(void)
535537 .evt .gatts_evt .conn_handle = CONN_HANDLE_1 ,
536538 };
537539
538- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
540+ ble_evt_send (& ble_evt );
539541
540542 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
541543 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -596,11 +598,6 @@ void test_ble_gq_item_add_req_gatts_hvx_error_invalid_param(void)
596598 TEST_ASSERT_EQUAL (NRF_ERROR_INVALID_PARAM , glob_error );
597599}
598600
599- void test_ble_gq_on_ble_evt_null (void )
600- {
601- ble_gq_on_ble_evt (NULL , NULL );
602- }
603-
604601void test_ble_gq_on_ble_evt_disconnected_event_item_purge (void )
605602{
606603 uint32_t nrf_err ;
@@ -631,7 +628,7 @@ void test_ble_gq_on_ble_evt_disconnected_event_item_purge(void)
631628 .evt .gap_evt .conn_handle = CONN_HANDLE_2 ,
632629 };
633630
634- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
631+ ble_evt_send (& ble_evt );
635632
636633 /* Purge in progress. Receive an (arbitrary) GATT event to trigger queue processing.
637634 * The item in the queue should be purged, so expect no call to the SoftDevice.
@@ -641,7 +638,7 @@ void test_ble_gq_on_ble_evt_disconnected_event_item_purge(void)
641638 .evt .gap_evt .conn_handle = CONN_HANDLE_2 ,
642639 };
643640
644- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
641+ ble_evt_send (& ble_evt );
645642
646643 TEST_ASSERT_EQUAL (BLE_CONN_HANDLE_INVALID , glob_conn_handle );
647644 TEST_ASSERT_EQUAL (NRF_SUCCESS , glob_error );
@@ -656,7 +653,7 @@ void setUp(void)
656653 /* Deregister all the registered connection handles by sending disconnect events. */
657654 for (uint32_t i = 0 ; i < ARRAY_SIZE (conn_handles ); ++ i ) {
658655 ble_evt .evt .gap_evt .conn_handle = conn_handles [i ];
659- ble_gq_on_ble_evt (& ble_evt , ( void * ) & ble_gq );
656+ ble_evt_send (& ble_evt );
660657 }
661658
662659 glob_conn_handle = BLE_CONN_HANDLE_INVALID ;
0 commit comments