1 /*
2  * Copyright (c) 2023 Codecoup
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/bluetooth/conn.h>
8 
9 #include "conn.h"
10 
bt_conn_index(const struct bt_conn * conn)11 uint8_t bt_conn_index(const struct bt_conn *conn)
12 {
13 	return conn->index;
14 }
15 
bt_conn_get_info(const struct bt_conn * conn,struct bt_conn_info * info)16 int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info)
17 {
18 	*info = conn->info;
19 
20 	return 0;
21 }
22 
bt_conn_ref(struct bt_conn * conn)23 struct bt_conn *bt_conn_ref(struct bt_conn *conn)
24 {
25 	return conn;
26 }
27 
bt_conn_unref(struct bt_conn * conn)28 void bt_conn_unref(struct bt_conn *conn)
29 {
30 
31 }
32 
mock_bt_conn_disconnected(struct bt_conn * conn,uint8_t err)33 void mock_bt_conn_disconnected(struct bt_conn *conn, uint8_t err)
34 {
35 	STRUCT_SECTION_FOREACH(bt_conn_cb, cb) {
36 		if (cb->disconnected) {
37 			cb->disconnected(conn, err);
38 		}
39 	}
40 }
41