1 /* 2 * Copyright (c) 2024 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #include <stddef.h> 7 #include <stdint.h> 8 9 #include <zephyr/bluetooth/audio/tbs.h> 10 #include <zephyr/bluetooth/conn.h> 11 #include <zephyr/sys/util_macro.h> 12 13 static struct bt_tbs_client_cb *tbs_cbs; 14 bt_tbs_client_register_cb(struct bt_tbs_client_cb * cbs)15int bt_tbs_client_register_cb(struct bt_tbs_client_cb *cbs) 16 { 17 tbs_cbs = cbs; 18 19 return 0; 20 } 21 bt_tbs_client_discover(struct bt_conn * conn)22int bt_tbs_client_discover(struct bt_conn *conn) 23 { 24 if (tbs_cbs != NULL && tbs_cbs->discover != NULL) { 25 uint8_t tbs_cnt = 0; 26 27 IF_ENABLED(CONFIG_BT_TBS_CLIENT_TBS, 28 (tbs_cnt += CONFIG_BT_TBS_CLIENT_MAX_TBS_INSTANCES)); 29 30 tbs_cbs->discover(conn, 0, tbs_cnt, IS_ENABLED(CONFIG_BT_TBS_CLIENT_GTBS)); 31 } 32 33 return 0; 34 } 35