1 /* 2 * Copyright 2023 NXP 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <stdint.h> 8 9 #include <zephyr/bluetooth/conn.h> 10 11 #if defined(CONFIG_BT_ASCS_ASE_SNK) 12 #define AVAILABLE_SINK_CONTEXT \ 13 (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ 14 BT_AUDIO_CONTEXT_TYPE_MEDIA | BT_AUDIO_CONTEXT_TYPE_GAME | \ 15 BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL) 16 #else 17 #define AVAILABLE_SINK_CONTEXT 0x0000 18 #endif /* CONFIG_BT_ASCS_ASE_SNK */ 19 20 #if defined(CONFIG_BT_ASCS_ASE_SRC) 21 #define AVAILABLE_SOURCE_CONTEXT \ 22 (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \ 23 BT_AUDIO_CONTEXT_TYPE_MEDIA | BT_AUDIO_CONTEXT_TYPE_GAME | \ 24 BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL) 25 #else 26 #define AVAILABLE_SOURCE_CONTEXT 0x0000 27 #endif /* CONFIG_BT_ASCS_ASE_SRC */ 28 /** 29 * @brief Initialize the VCP Volume Renderer role 30 * 31 * @return 0 if success, errno on failure. 32 */ 33 int vcp_vol_renderer_init(void); 34 35 /** 36 * @brief Initialize the CSIP Set Member role 37 * 38 * @return 0 if success, errno on failure. 39 */ 40 int csip_set_member_init(void); 41 42 /** 43 * @brief Generate the Resolvable Set Identifier (RSI) value. 44 * 45 * @param rsi Pointer to place the 6-octet newly generated RSI data. 46 * 47 * @return 0 if on success, errno on error. 48 */ 49 int csip_generate_rsi(uint8_t *rsi); 50 51 /** 52 * @brief Initialize BAP Unicast Server role 53 * 54 * @return 0 if success, errno on failure. 55 */ 56 int bap_unicast_sr_init(void); 57 58 /** 59 * @brief Initialize Call Control Client 60 * 61 * @param conn Pointer to connection. 62 * 63 * @return 0 if success, errno on failure. 64 */ 65 int ccp_call_ctrl_init(struct bt_conn *conn); 66 67 /** 68 * @brief Initiate a originate call command 69 * 70 * @return 0 if success, errno on failure. 71 */ 72 int ccp_originate_call(void); 73 74 /** 75 * @brief Initiate a terminate call command 76 * 77 * @return 0 if success, errno on failure. 78 */ 79 int ccp_terminate_call(void); 80 81 /** 82 * @brief Initialize Media Controller 83 * 84 * @param conn Pointer to connection. 85 * 86 * @return 0 if success, errno on failure. 87 */ 88 int mcp_ctlr_init(struct bt_conn *conn); 89 90 /** 91 * @brief Send a command to the Media Player 92 * 93 * @param mcp_opcode Command opcode. 94 * 95 * @return 0 if on success, errno on error. 96 */ 97 int mcp_send_cmd(uint8_t mcp_opcode); 98