From bfbb704c8e9fab547048413a8c20bb9dda22777c Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Sun, 9 Oct 2022 12:42:22 +0200 Subject: [PATCH] Bluetooth: Audio: Remove the bt_vcp_aics API The AICS functionality can be exercised using the bt_aics API instead. These functions did very little besides cluttering up the bt_vcp API. Signed-off-by: Emil Gydesen --- include/zephyr/bluetooth/audio/vcp.h | 141 --------- subsys/bluetooth/audio/vcp.c | 267 ------------------ subsys/bluetooth/audio/vcp_client.c | 27 -- subsys/bluetooth/audio/vcp_internal.h | 1 - subsys/bluetooth/shell/vcp.c | 22 +- subsys/bluetooth/shell/vcp_client.c | 22 +- .../bsim_test_audio/src/vcp_client_test.c | 22 +- .../bsim_bt/bsim_test_audio/src/vcp_test.c | 26 +- 8 files changed, 46 insertions(+), 482 deletions(-) diff --git a/include/zephyr/bluetooth/audio/vcp.h b/include/zephyr/bluetooth/audio/vcp.h index d1a9c2f2001..44118f227b1 100644 --- a/include/zephyr/bluetooth/audio/vcp.h +++ b/include/zephyr/bluetooth/audio/vcp.h @@ -385,147 +385,6 @@ int bt_vcp_vocs_description_get(struct bt_vcp *vcp, struct bt_vocs *inst); int bt_vcp_vocs_description_set(struct bt_vcp *vcp, struct bt_vocs *inst, const char *description); -/** - * @brief Deactivates an Audio Input Control Service instance. - * - * Audio Input Control Services are activated by default, but this will allow - * the server to deactivate an Audio Input Control Service. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_deactivate(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Activates an Audio Input Control Service instance. - * - * Audio Input Control Services are activated by default, but this will allow - * the server to reactivate an Audio Input Control Service instance after it has - * been deactivated with @ref bt_vcp_aics_deactivate. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_activate(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Read the Audio Input Control Service input state. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_state_get(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Read the Audio Input Control Service gain settings. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_gain_setting_get(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Read the Audio Input Control Service input type. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_type_get(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Read the Audio Input Control Service input status. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_status_get(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Mute the Audio Input Control Service input. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_mute(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Unmute the Audio Input Control Service input. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_unmute(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Set input gain to manual. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_manual_gain_set(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Set the input gain to automatic. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_automatic_gain_set(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Set the input gain. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * @param gain The gain in dB to set (-128 to 127). - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_gain_set(struct bt_vcp *vcp, struct bt_aics *inst, - int8_t gain); - -/** - * @brief Read the Audio Input Control Service description. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_description_get(struct bt_vcp *vcp, struct bt_aics *inst); - -/** - * @brief Set the Audio Input Control Service description. - * - * @param vcp Volume Control Service instance pointer. - * @param inst Pointer to the Audio Input Control Service instance. - * @param description The description to set. - * - * @return 0 if success, errno on failure. - */ -int bt_vcp_aics_description_set(struct bt_vcp *vcp, struct bt_aics *inst, - const char *description); - /** * @brief Registers the callbacks used by the Volume Control Service client. * diff --git a/subsys/bluetooth/audio/vcp.c b/subsys/bluetooth/audio/vcp.c index e1233cabf05..b74855a1cb5 100644 --- a/subsys/bluetooth/audio/vcp.c +++ b/subsys/bluetooth/audio/vcp.c @@ -44,23 +44,6 @@ static bool valid_vocs_inst(struct bt_vcp *vcp, struct bt_vocs *vocs) return false; } -static bool valid_aics_inst(struct bt_vcp *vcp, struct bt_aics *aics) -{ - if (aics == NULL) { - return false; - } - -#if defined(CONFIG_BT_VCP) - for (int i = 0; i < ARRAY_SIZE(vcp->srv.aics_insts); i++) { - if (vcp->srv.aics_insts[i] == aics) { - return true; - } - } -#endif /* CONFIG_BT_VCP */ - - return false; -} - #if defined(CONFIG_BT_VCP) #define VOLUME_DOWN(current_vol) \ @@ -417,45 +400,6 @@ int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp) return err; } - -int bt_vcp_aics_deactivate(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - CHECKIF(inst == NULL) { - LOG_DBG("NULL aics instance"); - return -EINVAL; - } - - if (!valid_aics_inst(vcp, inst)) { - return -EINVAL; - } - - return bt_aics_deactivate(inst); -} - -int bt_vcp_aics_activate(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - CHECKIF(inst == NULL) { - LOG_DBG("NULL aics instance"); - return -EINVAL; - } - - if (!valid_aics_inst(vcp, inst)) { - return -EINVAL; - } - - return bt_aics_activate(inst); -} - #endif /* CONFIG_BT_VCP */ int bt_vcp_included_get(struct bt_vcp *vcp, struct bt_vcp_included *included) @@ -833,214 +777,3 @@ int bt_vcp_vocs_description_set(struct bt_vcp *vcp, struct bt_vocs *inst, return -EOPNOTSUPP; } - -int bt_vcp_aics_state_get(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_state_get(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_state_get(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_gain_setting_get(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_gain_setting_get(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_gain_setting_get(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_type_get(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_type_get(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_type_get(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_status_get(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_status_get(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_status_get(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_unmute(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_unmute(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_unmute(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_mute(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_mute(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_mute(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_manual_gain_set(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_manual_gain_set(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_manual_gain_set(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_automatic_gain_set(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_automatic_gain_set(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_automatic_gain_set(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_gain_set(struct bt_vcp *vcp, struct bt_aics *inst, - int8_t gain) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_gain_set(inst, gain); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_gain_set(inst, gain); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_description_get(struct bt_vcp *vcp, struct bt_aics *inst) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_description_get(inst); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_description_get(inst); - } - - return -EOPNOTSUPP; -} - -int bt_vcp_aics_description_set(struct bt_vcp *vcp, struct bt_aics *inst, - const char *description) -{ - CHECKIF(vcp == NULL) { - LOG_DBG("NULL vcp instance"); - return -EINVAL; - } - - if (IS_ENABLED(CONFIG_BT_VCP_CLIENT_AICS) && - bt_vcp_client_valid_aics_inst(vcp, inst)) { - return bt_aics_description_set(inst, description); - } - - if (IS_ENABLED(CONFIG_BT_VCP_AICS) && valid_aics_inst(vcp, inst)) { - return bt_aics_description_set(inst, description); - } - - return -EOPNOTSUPP; -} diff --git a/subsys/bluetooth/audio/vcp_client.c b/subsys/bluetooth/audio/vcp_client.c index 3606d5a2258..199d7593a6b 100644 --- a/subsys/bluetooth/audio/vcp_client.c +++ b/subsys/bluetooth/audio/vcp_client.c @@ -61,33 +61,6 @@ bool bt_vcp_client_valid_vocs_inst(struct bt_vcp *vcp, struct bt_vocs *vocs) return false; } -bool bt_vcp_client_valid_aics_inst(struct bt_vcp *vcp, struct bt_aics *aics) -{ - if (vcp == NULL) { - return false; - } - - if (!vcp->client_instance) { - return false; - } - - if (vcp->cli.conn == NULL) { - return false; - } - - if (aics == NULL) { - return false; - } - - for (int i = 0; i < ARRAY_SIZE(vcp->cli.aics); i++) { - if (vcp->cli.aics[i] == aics) { - return true; - } - } - - return false; -} - static uint8_t vcp_client_notify_handler(struct bt_conn *conn, struct bt_gatt_subscribe_params *params, const void *data, uint16_t length) diff --git a/subsys/bluetooth/audio/vcp_internal.h b/subsys/bluetooth/audio/vcp_internal.h index d649c9fad7a..c841600585e 100644 --- a/subsys/bluetooth/audio/vcp_internal.h +++ b/subsys/bluetooth/audio/vcp_internal.h @@ -106,5 +106,4 @@ int bt_vcp_client_unmute(struct bt_vcp *vcp); int bt_vcp_client_mute(struct bt_vcp *vcp); bool bt_vcp_client_valid_vocs_inst(struct bt_vcp *vcp, struct bt_vocs *vocs); -bool bt_vcp_client_valid_aics_inst(struct bt_vcp *vcp, struct bt_aics *aics); #endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_*/ diff --git a/subsys/bluetooth/shell/vcp.c b/subsys/bluetooth/shell/vcp.c index 442f77fd25b..cf4c6e4192e 100644 --- a/subsys/bluetooth/shell/vcp.c +++ b/subsys/bluetooth/shell/vcp.c @@ -529,7 +529,7 @@ static int cmd_vcs_aics_input_state_get(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_state_get(NULL, vcp_included.aics[index]); + result = bt_aics_state_get(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -549,7 +549,7 @@ static int cmd_vcs_aics_gain_setting_get(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_gain_setting_get(NULL, vcp_included.aics[index]); + result = bt_aics_gain_setting_get(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -569,7 +569,7 @@ static int cmd_vcs_aics_input_type_get(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_type_get(NULL, vcp_included.aics[index]); + result = bt_aics_type_get(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -589,7 +589,7 @@ static int cmd_vcs_aics_input_status_get(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_status_get(NULL, vcp_included.aics[index]); + result = bt_aics_status_get(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -609,7 +609,7 @@ static int cmd_vcs_aics_input_unmute(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_unmute(NULL, vcp_included.aics[index]); + result = bt_aics_unmute(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -629,7 +629,7 @@ static int cmd_vcs_aics_input_mute(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_mute(NULL, vcp_included.aics[index]); + result = bt_aics_mute(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -649,7 +649,7 @@ static int cmd_vcs_aics_manual_input_gain_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_manual_gain_set(NULL, vcp_included.aics[index]); + result = bt_aics_manual_gain_set(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -669,7 +669,7 @@ static int cmd_vcs_aics_automatic_input_gain_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_automatic_gain_set(NULL, vcp_included.aics[index]); + result = bt_aics_automatic_gain_set(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -696,7 +696,7 @@ static int cmd_vcs_aics_gain_set(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_gain_set(NULL, vcp_included.aics[index], gain); + result = bt_aics_gain_set(vcp_included.aics[index], gain); if (result) { shell_print(sh, "Fail: %d", result); } @@ -716,7 +716,7 @@ static int cmd_vcs_aics_input_description_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_description_get(NULL, vcp_included.aics[index]); + result = bt_aics_description_get(vcp_included.aics[index]); if (result) { shell_print(sh, "Fail: %d", result); } @@ -737,7 +737,7 @@ static int cmd_vcs_aics_input_description_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_description_set(NULL, vcp_included.aics[index], + result = bt_aics_description_set(vcp_included.aics[index], description); if (result) { shell_print(sh, "Fail: %d", result); diff --git a/subsys/bluetooth/shell/vcp_client.c b/subsys/bluetooth/shell/vcp_client.c index 5d9c433235b..edf3c49fa4a 100644 --- a/subsys/bluetooth/shell/vcp_client.c +++ b/subsys/bluetooth/shell/vcp_client.c @@ -706,7 +706,7 @@ static int cmd_vcp_client_aics_input_state_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_state_get(vcp, vcp_included.aics[index]); + result = bt_aics_state_get(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -731,7 +731,7 @@ static int cmd_vcp_client_aics_gain_setting_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_gain_setting_get(vcp, vcp_included.aics[index]); + result = bt_aics_gain_setting_get(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -756,7 +756,7 @@ static int cmd_vcp_client_aics_input_type_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_type_get(vcp, vcp_included.aics[index]); + result = bt_aics_type_get(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -781,7 +781,7 @@ static int cmd_vcp_client_aics_input_status_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_status_get(vcp, vcp_included.aics[index]); + result = bt_aics_status_get(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -806,7 +806,7 @@ static int cmd_vcp_client_aics_input_unmute(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_unmute(vcp, vcp_included.aics[index]); + result = bt_aics_unmute(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -831,7 +831,7 @@ static int cmd_vcp_client_aics_input_mute(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_mute(vcp, vcp_included.aics[index]); + result = bt_aics_mute(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -856,7 +856,7 @@ static int cmd_vcp_client_aics_manual_input_gain_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_manual_gain_set(vcp, vcp_included.aics[index]); + result = bt_aics_manual_gain_set(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -881,7 +881,7 @@ static int cmd_vcp_client_aics_auto_input_gain_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_automatic_gain_set(vcp, vcp_included.aics[index]); + result = bt_aics_automatic_gain_set(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -913,7 +913,7 @@ static int cmd_vcp_client_aics_gain_set(const struct shell *sh, size_t argc, return -ENOEXEC; } - result = bt_vcp_aics_gain_set(vcp, vcp_included.aics[index], gain); + result = bt_aics_gain_set(vcp_included.aics[index], gain); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -938,7 +938,7 @@ static int cmd_vcp_client_aics_input_description_get(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_description_get(vcp, vcp_included.aics[index]); + result = bt_aics_description_get(vcp_included.aics[index]); if (result != 0) { shell_print(sh, "Fail: %d", result); } @@ -964,7 +964,7 @@ static int cmd_vcp_client_aics_input_description_set(const struct shell *sh, return -ENOEXEC; } - result = bt_vcp_aics_description_set(vcp, vcp_included.aics[index], + result = bt_aics_description_set(vcp_included.aics[index], description); if (result != 0) { shell_print(sh, "Fail: %d", result); diff --git a/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_client_test.c index aa3f9a37ac2..d6deda453c5 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_client_test.c @@ -310,7 +310,7 @@ static int test_aics(void) printk("Getting AICS state\n"); g_cb = false; - err = bt_vcp_aics_state_get(vcp, vcp_included.aics[0]); + err = bt_aics_state_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS state (err %d)\n", err); return err; @@ -320,7 +320,7 @@ static int test_aics(void) printk("Getting AICS gain setting\n"); g_cb = false; - err = bt_vcp_aics_gain_setting_get(vcp, vcp_included.aics[0]); + err = bt_aics_gain_setting_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS gain setting (err %d)\n", err); return err; @@ -331,7 +331,7 @@ static int test_aics(void) printk("Getting AICS input type\n"); expected_input_type = BT_AICS_INPUT_TYPE_DIGITAL; g_cb = false; - err = bt_vcp_aics_type_get(vcp, vcp_included.aics[0]); + err = bt_aics_type_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS input type (err %d)\n", err); return err; @@ -342,7 +342,7 @@ static int test_aics(void) printk("Getting AICS status\n"); g_cb = false; - err = bt_vcp_aics_status_get(vcp, vcp_included.aics[0]); + err = bt_aics_status_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS status (err %d)\n", err); return err; @@ -352,7 +352,7 @@ static int test_aics(void) printk("Getting AICS description\n"); g_cb = false; - err = bt_vcp_aics_description_get(vcp, vcp_included.aics[0]); + err = bt_aics_description_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS description (err %d)\n", err); return err; @@ -363,7 +363,7 @@ static int test_aics(void) printk("Setting AICS mute\n"); expected_input_mute = BT_AICS_STATE_MUTED; g_write_complete = g_cb = false; - err = bt_vcp_aics_mute(vcp, vcp_included.aics[0]); + err = bt_aics_mute(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS mute (err %d)\n", err); return err; @@ -375,7 +375,7 @@ static int test_aics(void) printk("Setting AICS unmute\n"); expected_input_mute = BT_AICS_STATE_UNMUTED; g_write_complete = g_cb = false; - err = bt_vcp_aics_unmute(vcp, vcp_included.aics[0]); + err = bt_aics_unmute(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS unmute (err %d)\n", err); return err; @@ -387,7 +387,7 @@ static int test_aics(void) printk("Setting AICS auto mode\n"); expected_mode = BT_AICS_MODE_AUTO; g_write_complete = g_cb = false; - err = bt_vcp_aics_automatic_gain_set(vcp, vcp_included.aics[0]); + err = bt_aics_automatic_gain_set(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS auto mode (err %d)\n", err); return err; @@ -398,7 +398,7 @@ static int test_aics(void) printk("Setting AICS manual mode\n"); expected_mode = BT_AICS_MODE_MANUAL; g_write_complete = g_cb = false; - err = bt_vcp_aics_manual_gain_set(vcp, vcp_included.aics[0]); + err = bt_aics_manual_gain_set(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS manual mode (err %d)\n", err); return err; @@ -409,7 +409,7 @@ static int test_aics(void) printk("Setting AICS gain\n"); expected_gain = g_aics_gain_max - 1; g_write_complete = g_cb = false; - err = bt_vcp_aics_gain_set(vcp, vcp_included.aics[0], expected_gain); + err = bt_aics_gain_set(vcp_included.aics[0], expected_gain); if (err) { FAIL("Could not set AICS gain (err %d)\n", err); return err; @@ -422,7 +422,7 @@ static int test_aics(void) sizeof(expected_aics_desc)); expected_aics_desc[sizeof(expected_aics_desc) - 1] = '\0'; g_cb = false; - err = bt_vcp_aics_description_set(vcp, vcp_included.aics[0], + err = bt_aics_description_set(vcp_included.aics[0], expected_aics_desc); if (err) { FAIL("Could not set AICS Description (err %d)\n", err); diff --git a/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_test.c b/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_test.c index 13a29601468..9c3f5956bcd 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_audio/src/vcp_test.c @@ -218,7 +218,7 @@ static int test_aics_standalone(void) printk("Deactivating AICS\n"); expected_aics_active = false; - err = bt_vcp_aics_deactivate(vcp, vcp_included.aics[0]); + err = bt_aics_deactivate(vcp_included.aics[0]); if (err) { FAIL("Could not deactivate AICS (err %d)\n", err); return err; @@ -228,7 +228,7 @@ static int test_aics_standalone(void) printk("Activating AICS\n"); expected_aics_active = true; - err = bt_vcp_aics_activate(vcp, vcp_included.aics[0]); + err = bt_aics_activate(vcp_included.aics[0]); if (err) { FAIL("Could not activate AICS (err %d)\n", err); return err; @@ -238,7 +238,7 @@ static int test_aics_standalone(void) printk("Getting AICS state\n"); g_cb = false; - err = bt_vcp_aics_state_get(vcp, vcp_included.aics[0]); + err = bt_aics_state_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS state (err %d)\n", err); return err; @@ -248,7 +248,7 @@ static int test_aics_standalone(void) printk("Getting AICS gain setting\n"); g_cb = false; - err = bt_vcp_aics_gain_setting_get(vcp, vcp_included.aics[0]); + err = bt_aics_gain_setting_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS gain setting (err %d)\n", err); return err; @@ -258,7 +258,7 @@ static int test_aics_standalone(void) printk("Getting AICS input type\n"); expected_input_type = BT_AICS_INPUT_TYPE_DIGITAL; - err = bt_vcp_aics_type_get(vcp, vcp_included.aics[0]); + err = bt_aics_type_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS input type (err %d)\n", err); return err; @@ -269,7 +269,7 @@ static int test_aics_standalone(void) printk("Getting AICS status\n"); g_cb = false; - err = bt_vcp_aics_status_get(vcp, vcp_included.aics[0]); + err = bt_aics_status_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS status (err %d)\n", err); return err; @@ -279,7 +279,7 @@ static int test_aics_standalone(void) printk("Getting AICS description\n"); g_cb = false; - err = bt_vcp_aics_description_get(vcp, vcp_included.aics[0]); + err = bt_aics_description_get(vcp_included.aics[0]); if (err) { FAIL("Could not get AICS description (err %d)\n", err); return err; @@ -289,7 +289,7 @@ static int test_aics_standalone(void) printk("Setting AICS mute\n"); expected_input_mute = BT_AICS_STATE_MUTED; - err = bt_vcp_aics_mute(vcp, vcp_included.aics[0]); + err = bt_aics_mute(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS mute (err %d)\n", err); return err; @@ -299,7 +299,7 @@ static int test_aics_standalone(void) printk("Setting AICS unmute\n"); expected_input_mute = BT_AICS_STATE_UNMUTED; - err = bt_vcp_aics_unmute(vcp, vcp_included.aics[0]); + err = bt_aics_unmute(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS unmute (err %d)\n", err); return err; @@ -309,7 +309,7 @@ static int test_aics_standalone(void) printk("Setting AICS auto mode\n"); expected_mode = BT_AICS_MODE_AUTO; - err = bt_vcp_aics_automatic_gain_set(vcp, vcp_included.aics[0]); + err = bt_aics_automatic_gain_set(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS auto mode (err %d)\n", err); return err; @@ -319,7 +319,7 @@ static int test_aics_standalone(void) printk("Setting AICS manual mode\n"); expected_mode = BT_AICS_MODE_MANUAL; - err = bt_vcp_aics_manual_gain_set(vcp, vcp_included.aics[0]); + err = bt_aics_manual_gain_set(vcp_included.aics[0]); if (err) { FAIL("Could not set AICS manual mode (err %d)\n", err); return err; @@ -329,7 +329,7 @@ static int test_aics_standalone(void) printk("Setting AICS gain\n"); expected_gain = g_aics_gain_max - 1; - err = bt_vcp_aics_gain_set(vcp, vcp_included.aics[0], expected_gain); + err = bt_aics_gain_set(vcp_included.aics[0], expected_gain); if (err) { FAIL("Could not set AICS gain (err %d)\n", err); return err; @@ -342,7 +342,7 @@ static int test_aics_standalone(void) sizeof(expected_aics_desc)); expected_aics_desc[sizeof(expected_aics_desc) - 1] = '\0'; g_cb = false; - err = bt_vcp_aics_description_set(vcp, vcp_included.aics[0], + err = bt_aics_description_set(vcp_included.aics[0], expected_aics_desc); if (err) { FAIL("Could not set AICS Description (err %d)\n", err);