1 /*
2 * Copyright (c) 2023-2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/bluetooth/audio/cap.h>
8 #include <zephyr/bluetooth/audio/csip.h>
9 #include <zephyr/bluetooth/bluetooth.h>
10
11 #include "cap_initiator.h"
12 #include "zephyr/fff.h"
13
14 /* List of fakes used by this unit tester */
15 #define FFF_FAKES_LIST(FAKE) \
16 FAKE(mock_cap_initiator_unicast_discovery_complete_cb) \
17 FAKE(mock_cap_initiator_unicast_start_complete_cb) \
18 FAKE(mock_cap_initiator_unicast_update_complete_cb) \
19 FAKE(mock_cap_initiator_unicast_stop_complete_cb)
20
21 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_unicast_discovery_complete_cb, struct bt_conn *, int,
22 const struct bt_csip_set_coordinator_set_member *,
23 const struct bt_csip_set_coordinator_csis_inst *);
24
25 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_unicast_start_complete_cb, int, struct bt_conn *);
26 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_unicast_update_complete_cb, int, struct bt_conn *);
27 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_unicast_stop_complete_cb, int, struct bt_conn *);
28 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_broadcast_started_cb, struct bt_cap_broadcast_source *);
29 DEFINE_FAKE_VOID_FUNC(mock_cap_initiator_broadcast_stopped_cb, struct bt_cap_broadcast_source *,
30 uint8_t);
31
32 const struct bt_cap_initiator_cb mock_cap_initiator_cb = {
33 #if defined(CONFIG_BT_BAP_UNICAST_CLIENT)
34 .unicast_discovery_complete = mock_cap_initiator_unicast_discovery_complete_cb,
35 .unicast_start_complete = mock_cap_initiator_unicast_start_complete_cb,
36 .unicast_update_complete = mock_cap_initiator_unicast_update_complete_cb,
37 .unicast_stop_complete = mock_cap_initiator_unicast_stop_complete_cb,
38 #endif /* CONFIG_BT_BAP_UNICAST_CLIENT */
39 #if defined(CONFIG_BT_BAP_BROADCAST_SOURCE)
40 .broadcast_started = mock_cap_initiator_broadcast_started_cb,
41 .broadcast_stopped = mock_cap_initiator_broadcast_stopped_cb,
42 #endif /* CONFIG_BT_BAP_BROADCAST_SOURCE */
43 };
44
mock_cap_initiator_init(void)45 void mock_cap_initiator_init(void)
46 {
47 FFF_FAKES_LIST(RESET_FAKE);
48 }
49
mock_cap_initiator_cleanup(void)50 void mock_cap_initiator_cleanup(void)
51 {
52 }
53