1 /* 2 * Copyright (c) 2023 Codecoup 3 * Copyright (c) 2024 Nordic Semiconductor ASA 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef MOCKS_CONN_H_ 9 #define MOCKS_CONN_H_ 10 #include <stdint.h> 11 12 #include <stdint.h> 13 14 #include <zephyr/bluetooth/addr.h> 15 #include <zephyr/bluetooth/bluetooth.h> 16 #include <zephyr/bluetooth/conn.h> 17 #include <zephyr/fff.h> 18 19 /* List of fakes used by this unit tester */ 20 #define CONN_FFF_FAKES_LIST(FAKE) \ 21 FAKE(bt_conn_foreach) \ 22 FAKE(bt_conn_get_dst) \ 23 FAKE(bt_foreach_bond) 24 25 typedef void (*bt_conn_foreach_cb)(struct bt_conn *, void *); 26 typedef void (*bt_foreach_bond_cb)(const struct bt_bond_info *, void *); 27 DECLARE_FAKE_VOID_FUNC(bt_conn_foreach, enum bt_conn_type, bt_conn_foreach_cb, void *); 28 DECLARE_FAKE_VALUE_FUNC(const bt_addr_le_t *, bt_conn_get_dst, const struct bt_conn *); 29 DECLARE_FAKE_VOID_FUNC(bt_foreach_bond, uint8_t, bt_foreach_bond_cb, void *); 30 31 struct bt_conn { 32 uint8_t index; 33 struct bt_conn_info info; 34 struct bt_iso_chan *chan; 35 }; 36 37 void mock_bt_conn_connected(struct bt_conn *conn, uint8_t err); 38 void mock_bt_conn_disconnected(struct bt_conn *conn, uint8_t err); 39 40 #endif /* MOCKS_CONN_H_ */ 41