Bluetooth: Audio: Specify bt_vcp_vol_rend API

The VCP server, known as the volume renderer, has a
more explicity bt_vcp_vol_rend API naming scheme now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-10-09 13:54:58 +02:00 committed by Carles Cufí
commit 7f69b866f0
17 changed files with 400 additions and 387 deletions

View file

@ -27,13 +27,13 @@
extern "C" {
#endif
#if defined(CONFIG_BT_VCP)
#define BT_VCP_VOCS_CNT CONFIG_BT_VCP_VOCS_INSTANCE_COUNT
#define BT_VCP_AICS_CNT CONFIG_BT_VCP_AICS_INSTANCE_COUNT
#if defined(CONFIG_BT_VCP_VOL_REND)
#define BT_VCP_VOL_REND_VOCS_CNT CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT
#define BT_VCP_VOL_REND_AICS_CNT CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT
#else
#define BT_VCP_VOCS_CNT 0
#define BT_VCP_AICS_CNT 0
#endif /* CONFIG_BT_VCP */
#define BT_VCP_VOL_REND_VOCS_CNT 0
#define BT_VCP_VOL_REND_AICS_CNT 0
#endif /* CONFIG_BT_VCP_VOL_REND */
/** Volume Control Service Error codes */
#define BT_VCP_ERR_INVALID_COUNTER 0x80
@ -47,7 +47,7 @@ extern "C" {
struct bt_vcp;
/** Register structure for Volume Control Service */
struct bt_vcp_register_param {
struct bt_vcp_vol_rend_register_param {
/** Initial step size (1-255) */
uint8_t step;
@ -58,10 +58,10 @@ struct bt_vcp_register_param {
uint8_t volume;
/** Register parameters for Volume Offset Control Services */
struct bt_vocs_register_param vocs_param[BT_VCP_VOCS_CNT];
struct bt_vocs_register_param vocs_param[BT_VCP_VOL_REND_VOCS_CNT];
/** Register parameters for Audio Input Control Services */
struct bt_aics_register_param aics_param[BT_VCP_AICS_CNT];
struct bt_aics_register_param aics_param[BT_VCP_VOL_REND_AICS_CNT];
/** Volume Control Service callback structure. */
struct bt_vcp_cb *cb;
@ -86,20 +86,6 @@ struct bt_vcp_included {
struct bt_aics **aics;
};
/**
* @brief Register the Volume Control Service.
*
* This will register and enable the service and make it discoverable by
* clients.
*
* @param param Volume Control Service register parameters.
* @param[out] vcp Pointer to the registered Volume Control Service.
* This will still be valid if the return value is -EALREADY.
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp);
/**
* @brief Get Volume Control Service included services.
*
@ -113,7 +99,23 @@ int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_included_get(struct bt_vcp *vcp, struct bt_vcp_included *included);
int bt_vcp_vol_rend_included_get(struct bt_vcp *vcp,
struct bt_vcp_included *included);
/**
* @brief Register the Volume Control Service.
*
* This will register and enable the service and make it discoverable by
* clients.
*
* @param param Volume Control Service register parameters.
* @param[out] vcp Pointer to the registered Volume Control Service.
* This will still be valid if the return value is -EALREADY.
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_rend_register(struct bt_vcp_vol_rend_register_param *param,
struct bt_vcp **vcp);
/**
* @brief Callback function for bt_vcp_vol_ctlr_discover.
@ -197,7 +199,7 @@ struct bt_vcp_cb {
* @brief Set the Volume Control Service volume step size.
*
* Set the value that the volume changes, when changed relatively with e.g.
* @ref bt_vcp_vol_down or @ref bt_vcp_vol_up.
* @ref bt_vcp_vol_rend_vol_down or @ref bt_vcp_vol_rend_vol_up.
*
* This can only be done as the server.
*
@ -205,25 +207,25 @@ struct bt_vcp_cb {
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_step_set(uint8_t volume_step);
int bt_vcp_vol_rend_set_step(uint8_t volume_step);
/**
* @brief Read the Volume Control Service volume state.
* @brief Get the Volume Control Service volume state.
*
* @param vcp Volume Control Service instance pointer.
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_get(struct bt_vcp *vcp);
int bt_vcp_vol_rend_get_state(struct bt_vcp *vcp);
/**
* @brief Read the Volume Control Service flags.
* @brief Get the Volume Control Service flags.
*
* @param vcp Volume Control Service instance pointer.
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_flags_get(struct bt_vcp *vcp);
int bt_vcp_vol_rend_get_flags(struct bt_vcp *vcp);
/**
* @brief Turn the volume down by one step on the server.
@ -232,7 +234,7 @@ int bt_vcp_flags_get(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_down(struct bt_vcp *vcp);
int bt_vcp_vol_rend_vol_down(struct bt_vcp *vcp);
/**
* @brief Turn the volume up by one step on the server.
@ -241,7 +243,7 @@ int bt_vcp_vol_down(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_up(struct bt_vcp *vcp);
int bt_vcp_vol_rend_vol_up(struct bt_vcp *vcp);
/**
* @brief Turn the volume down and unmute the server.
@ -250,7 +252,7 @@ int bt_vcp_vol_up(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_unmute_vol_down(struct bt_vcp *vcp);
int bt_vcp_vol_rend_unmute_vol_down(struct bt_vcp *vcp);
/**
* @brief Turn the volume up and unmute the server.
@ -259,7 +261,7 @@ int bt_vcp_unmute_vol_down(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_unmute_vol_up(struct bt_vcp *vcp);
int bt_vcp_vol_rend_unmute_vol_up(struct bt_vcp *vcp);
/**
* @brief Set the volume on the server
@ -269,7 +271,7 @@ int bt_vcp_unmute_vol_up(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_vol_set(struct bt_vcp *vcp, uint8_t volume);
int bt_vcp_vol_rend_set_vol(struct bt_vcp *vcp, uint8_t volume);
/**
* @brief Unmute the server.
@ -278,7 +280,7 @@ int bt_vcp_vol_set(struct bt_vcp *vcp, uint8_t volume);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_unmute(struct bt_vcp *vcp);
int bt_vcp_vol_rend_unmute(struct bt_vcp *vcp);
/**
* @brief Mute the server.
@ -287,7 +289,7 @@ int bt_vcp_unmute(struct bt_vcp *vcp);
*
* @return 0 if success, errno on failure.
*/
int bt_vcp_mute(struct bt_vcp *vcp);
int bt_vcp_vol_rend_mute(struct bt_vcp *vcp);
/**
* @brief Registers the callbacks used by the Volume Controller.

View file

@ -3,4 +3,4 @@ CONFIG_BT_HAS_HEARING_AID_BANDED=y
# If the HA supports the Volume Balance feature (see Section 3.1) and the HA
# is a Banded Hearing Aid, the HA shall instantiate two instances of VOCS.
CONFIG_BT_VOCS_MAX_INSTANCE_COUNT=2
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=2
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=2

View file

@ -26,7 +26,7 @@ CONFIG_BT_PACS_SRC_CONTEXT=0x0003
CONFIG_BT_PAC_SNK_LOC=y
CONFIG_BT_PAC_SRC_LOC=y
CONFIG_BT_VCP=y
CONFIG_BT_VCP_VOL_REND=y
CONFIG_BT_MICP_MIC_DEV=y
CONFIG_BT_HAS=y
CONFIG_BT_HAS_HEARING_AID_MONAURAL=y
@ -37,7 +37,7 @@ CONFIG_BT_CAP_ACCEPTOR=y
CONFIG_BT_AICS_MAX_INSTANCE_COUNT=2
# The HA may expose an instance of MICS and an instance of AICS to control
# the capture of ambient sound.
CONFIG_BT_VCP_AICS_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT=1
# An HA may instantiate one or more instances of Audio Input Control Service
# (AICS) to expose control of the gain of its inputs to a Volume Controller.
CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT=1
@ -46,7 +46,7 @@ CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT=1
# is part of a Binaural Hearing Aid Set, the HA shall instantiate one instance
# of Volume Offset Control Service (VOCS).
CONFIG_BT_VOCS_MAX_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=1
CONFIG_BT_BAS=y
CONFIG_BT_IAS=y

View file

@ -133,44 +133,44 @@ static struct bt_vocs_cb vocs_cbs = {
int vcp_vol_renderer_init(void)
{
int err;
struct bt_vcp_register_param vcs_param;
char input_desc[CONFIG_BT_VCP_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOCS_INSTANCE_COUNT][16];
struct bt_vcp_vol_rend_register_param vcp_register_param;
char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT][16];
memset(&vcs_param, 0, sizeof(vcs_param));
memset(&vcp_register_param, 0, sizeof(vcp_register_param));
for (int i = 0; i < ARRAY_SIZE(vcs_param.vocs_param); i++) {
vcs_param.vocs_param[i].location_writable = true;
vcs_param.vocs_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.vocs_param); i++) {
vcp_register_param.vocs_param[i].location_writable = true;
vcp_register_param.vocs_param[i].desc_writable = true;
snprintf(output_desc[i], sizeof(output_desc[i]), "Output %d", i + 1);
vcs_param.vocs_param[i].output_desc = output_desc[i];
vcs_param.vocs_param[i].cb = &vocs_cbs;
vcp_register_param.vocs_param[i].output_desc = output_desc[i];
vcp_register_param.vocs_param[i].cb = &vocs_cbs;
}
for (int i = 0; i < ARRAY_SIZE(vcs_param.aics_param); i++) {
vcs_param.aics_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.aics_param); i++) {
vcp_register_param.aics_param[i].desc_writable = true;
snprintf(input_desc[i], sizeof(input_desc[i]), "Input %d", i + 1);
vcs_param.aics_param[i].description = input_desc[i];
vcs_param.aics_param[i].type = BT_AICS_INPUT_TYPE_UNSPECIFIED;
vcs_param.aics_param[i].status = true;
vcs_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcs_param.aics_param[i].units = 1;
vcs_param.aics_param[i].min_gain = -100;
vcs_param.aics_param[i].max_gain = 100;
vcs_param.aics_param[i].cb = &aics_cbs;
vcp_register_param.aics_param[i].description = input_desc[i];
vcp_register_param.aics_param[i].type = BT_AICS_INPUT_TYPE_UNSPECIFIED;
vcp_register_param.aics_param[i].status = true;
vcp_register_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcp_register_param.aics_param[i].units = 1;
vcp_register_param.aics_param[i].min_gain = -100;
vcp_register_param.aics_param[i].max_gain = 100;
vcp_register_param.aics_param[i].cb = &aics_cbs;
}
vcs_param.step = 1;
vcs_param.mute = BT_VCP_STATE_UNMUTED;
vcs_param.volume = 100;
vcs_param.cb = &vcs_cbs;
vcp_register_param.step = 1;
vcp_register_param.mute = BT_VCP_STATE_UNMUTED;
vcp_register_param.volume = 100;
vcp_register_param.cb = &vcs_cbs;
err = bt_vcp_register(&vcs_param, &vcs);
err = bt_vcp_vol_rend_register(&vcp_register_param, &vcp);
if (err) {
return err;
}
err = bt_vcp_included_get(vcs, &vcp_included);
err = bt_vcp_vol_rend_included_get(vcp, &vcp_included);
if (err != 0) {
return err;
}

View file

@ -16,7 +16,7 @@ if (CONFIG_BT_AICS OR CONFIG_BT_AICS_CLIENT)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_AICS_CLIENT aics_client.c)
zephyr_library_sources_ifdef(CONFIG_BT_VCP vcp.c)
zephyr_library_sources_ifdef(CONFIG_BT_VCP_VOL_REND vcp_vol_rend.c)
zephyr_library_sources_ifdef(CONFIG_BT_VCP_VOL_CTLR vcp_vol_ctlr.c)
if (CONFIG_BT_MICP_MIC_DEV)

View file

@ -1,21 +1,22 @@
# Bluetooth Audio - Call control configuration options
# Bluetooth Audio - Volume Control Profile configuration options
#
# Copyright (c) 2020 Bose Corporation
# Copyright (c) 2020-2021 Nordic Semiconductor ASA
# Copyright (c) 2020-2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
##################### Volume Control Service #####################
################### Volume Control Profile Volume Renderer ###################
config BT_VCP
bool "Volume Control Profile Support [EXPERIMENTAL]"
config BT_VCP_VOL_REND
bool "Volume Control Profile Volume Renderer Support [EXPERIMENTAL]"
select EXPERIMENTAL
help
This option enables support for Volume Control Service.
This option enables support for Volume Control Profile Volume Renderer
role and the Volume Control Service.
if BT_VCP
config BT_VCP_VOCS_INSTANCE_COUNT
if BT_VCP_VOL_REND
config BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT
int "Volume Offset Control Service instance count"
default 0
range 0 BT_VOCS_MAX_INSTANCE_COUNT
@ -23,14 +24,14 @@ config BT_VCP_VOCS_INSTANCE_COUNT
This option sets the number of instances of Volume Offset Control
Services.
config BT_VCP_VOCS
config BT_VCP_VOL_REND_VOCS
bool # Hidden
default y if BT_VCP_VOCS_INSTANCE_COUNT > 0
default y if BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT > 0
help
This hidden option makes it possible to easily check if VOCS is
enabled for VCS.
config BT_VCP_AICS_INSTANCE_COUNT
config BT_VCP_VOL_REND_AICS_INSTANCE_COUNT
int "Audio Input Control Service instance count for VCS"
default 0
range 0 BT_AICS_MAX_INSTANCE_COUNT
@ -38,30 +39,30 @@ config BT_VCP_AICS_INSTANCE_COUNT
This option sets the number of instances of Audio Input Control
Services for VCS.
config BT_VCP_AICS
config BT_VCP_VOL_REND_AICS
bool # Hidden
default y if BT_VCP_AICS_INSTANCE_COUNT > 0
default y if BT_VCP_VOL_REND_AICS_INSTANCE_COUNT > 0
help
This hidden option makes it possible to easily check if AICS is
enabled for VCS.
############# DEBUG #############
config BT_DEBUG_VCP
bool "Volume Control Profile debug"
config BT_DEBUG_VCP_VOL_REND
bool "Volume Control Profile Volume Renderer debug"
select DEPRECATED
help
Use this option to enable Volume Control Profile debug logs for the
Bluetooth Audio functionality.
module = BT_VCS
legacy-debug-sym = BT_DEBUG_VCP
module-str = "Volume Control Profile"
module = BT_VCP_VOL_REND
legacy-debug-sym = BT_DEBUG_VCP_VOL_REND
module-str = "Volume Control Profile Voluem Renderer"
source "subsys/bluetooth/common/Kconfig.template.log_config_bt"
endif # BT_VCS
endif # BT_VCP_VOL_REND
##################### Volume Control Profile Client #####################
################### Volume Control Profile Volume Controller ###################
config BT_VCP_VOL_CTLR
bool "Volume Control Profile Volume Controller Support [EXPERIMENTAL]"

View file

@ -67,7 +67,7 @@ struct bt_vcp_vol_ctlr {
};
#endif /* CONFIG_BT_VCP_VOL_CTLR */
#if defined(CONFIG_BT_VCP)
#if defined(CONFIG_BT_VCP_VOL_REND)
struct bt_vcp_server {
struct vcs_state state;
uint8_t flags;
@ -75,18 +75,18 @@ struct bt_vcp_server {
uint8_t volume_step;
struct bt_gatt_service *service_p;
struct bt_vocs *vocs_insts[CONFIG_BT_VCP_VOCS_INSTANCE_COUNT];
struct bt_aics *aics_insts[CONFIG_BT_VCP_AICS_INSTANCE_COUNT];
struct bt_vocs *vocs_insts[CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT];
struct bt_aics *aics_insts[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT];
};
#endif /* CONFIG_BT_VCP */
#endif /* CONFIG_BT_VCP_VOL_REND */
/* Struct used as a common type for the api */
struct bt_vcp {
bool client_instance;
union {
#if defined(CONFIG_BT_VCP)
#if defined(CONFIG_BT_VCP_VOL_REND)
struct bt_vcp_server srv;
#endif /* CONFIG_BT_VCP */
#endif /* CONFIG_BT_VCP_VOL_REND */
#if defined(CONFIG_BT_VCP_VOL_CTLR)
struct bt_vcp_vol_ctlr cli;
#endif /* CONFIG_BT_VCP_VOL_CTLR */

View file

@ -23,9 +23,9 @@
#include "audio_internal.h"
#include "vcp_internal.h"
#define LOG_LEVEL CONFIG_BT_VCP_LOG_LEVEL
#define LOG_LEVEL CONFIG_BT_VCP_VOL_REND_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bt_vcp);
LOG_MODULE_REGISTER(bt_vcp_vol_rend);
#define VOLUME_DOWN(current_vol) \
((uint8_t)MAX(0, (int)current_vol - vcp_inst.srv.volume_step))
@ -212,8 +212,8 @@ static ssize_t read_flags(struct bt_conn *conn, const struct bt_gatt_attr *attr,
#define BT_VCS_DEFINITION \
BT_GATT_PRIMARY_SERVICE(BT_UUID_VCS), \
VOCS_INCLUDES(CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) \
AICS_INCLUDES(CONFIG_BT_VCP_AICS_INSTANCE_COUNT) \
VOCS_INCLUDES(CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) \
AICS_INCLUDES(CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT) \
BT_AUDIO_CHRC(BT_UUID_VCS_STATE, \
BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY, \
BT_GATT_PERM_READ_ENCRYPT, \
@ -232,7 +232,7 @@ static ssize_t read_flags(struct bt_conn *conn, const struct bt_gatt_attr *attr,
static struct bt_gatt_attr vcs_attrs[] = { BT_VCS_DEFINITION };
static struct bt_gatt_service vcs_svc;
static int prepare_vocs_inst(struct bt_vcp_register_param *param)
static int prepare_vocs_inst(struct bt_vcp_vol_rend_register_param *param)
{
int err;
int j;
@ -263,19 +263,19 @@ static int prepare_vocs_inst(struct bt_vcp_register_param *param)
vcs_attrs[i].user_data = bt_vocs_svc_decl_get(vcp_inst.srv.vocs_insts[j]);
j++;
if (j == CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (j == CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
break;
}
}
}
__ASSERT(j == CONFIG_BT_VCP_VOCS_INSTANCE_COUNT,
__ASSERT(j == CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT,
"Invalid VOCS instance count");
return 0;
}
static int prepare_aics_inst(struct bt_vcp_register_param *param)
static int prepare_aics_inst(struct bt_vcp_vol_rend_register_param *param)
{
int err;
int j;
@ -307,20 +307,21 @@ static int prepare_aics_inst(struct bt_vcp_register_param *param)
LOG_DBG("AICS P %p", vcs_attrs[i].user_data);
if (j == CONFIG_BT_VCP_AICS_INSTANCE_COUNT) {
if (j == CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT) {
break;
}
}
}
__ASSERT(j == CONFIG_BT_VCP_AICS_INSTANCE_COUNT,
__ASSERT(j == CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT,
"Invalid AICS instance count");
return 0;
}
/****************************** PUBLIC API ******************************/
int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp)
int bt_vcp_vol_rend_register(struct bt_vcp_vol_rend_register_param *param,
struct bt_vcp **vcp)
{
static bool registered;
int err;
@ -347,7 +348,7 @@ int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp)
vcs_svc = (struct bt_gatt_service)BT_GATT_SERVICE(vcs_attrs);
if (CONFIG_BT_VCP_VOCS_INSTANCE_COUNT > 0) {
if (CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT > 0) {
err = prepare_vocs_inst(param);
if (err != 0) {
@ -355,7 +356,7 @@ int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp)
}
}
if (CONFIG_BT_VCP_AICS_INSTANCE_COUNT > 0) {
if (CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT > 0) {
err = prepare_aics_inst(param);
if (err != 0) {
@ -382,7 +383,7 @@ int bt_vcp_register(struct bt_vcp_register_param *param, struct bt_vcp **vcp)
return err;
}
int bt_vcp_included_get(struct bt_vcp *vcp, struct bt_vcp_included *included)
int bt_vcp_vol_rend_included_get(struct bt_vcp *vcp, struct bt_vcp_included *included)
{
CHECKIF(vcp == NULL) {
LOG_DBG("NULL vcp instance");
@ -402,7 +403,7 @@ int bt_vcp_included_get(struct bt_vcp *vcp, struct bt_vcp_included *included)
return 0;
}
int bt_vcp_vol_step_set(uint8_t volume_step)
int bt_vcp_vol_rend_set_step(uint8_t volume_step)
{
if (volume_step > 0) {
vcp_inst.srv.volume_step = volume_step;
@ -412,7 +413,7 @@ int bt_vcp_vol_step_set(uint8_t volume_step)
}
}
int bt_vcp_vol_get(struct bt_vcp *vcp)
int bt_vcp_vol_rend_get_state(struct bt_vcp *vcp)
{
CHECKIF(vcp == NULL) {
LOG_DBG("NULL vcp instance");
@ -427,7 +428,7 @@ int bt_vcp_vol_get(struct bt_vcp *vcp)
return 0;
}
int bt_vcp_flags_get(struct bt_vcp *vcp)
int bt_vcp_vol_rend_get_flags(struct bt_vcp *vcp)
{
CHECKIF(vcp == NULL) {
LOG_DBG("NULL vcp instance");
@ -441,7 +442,7 @@ int bt_vcp_flags_get(struct bt_vcp *vcp)
return 0;
}
int bt_vcp_vol_down(struct bt_vcp *vcp)
int bt_vcp_vol_rend_vol_down(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_REL_VOL_DOWN,
@ -459,7 +460,7 @@ int bt_vcp_vol_down(struct bt_vcp *vcp)
return err > 0 ? 0 : err;
}
int bt_vcp_vol_up(struct bt_vcp *vcp)
int bt_vcp_vol_rend_vol_up(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_REL_VOL_UP,
@ -477,7 +478,7 @@ int bt_vcp_vol_up(struct bt_vcp *vcp)
return err > 0 ? 0 : err;
}
int bt_vcp_unmute_vol_down(struct bt_vcp *vcp)
int bt_vcp_vol_rend_unmute_vol_down(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_UNMUTE_REL_VOL_DOWN,
@ -495,7 +496,7 @@ int bt_vcp_unmute_vol_down(struct bt_vcp *vcp)
return err > 0 ? 0 : err;
}
int bt_vcp_unmute_vol_up(struct bt_vcp *vcp)
int bt_vcp_vol_rend_unmute_vol_up(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_UNMUTE_REL_VOL_UP,
@ -513,7 +514,7 @@ int bt_vcp_unmute_vol_up(struct bt_vcp *vcp)
return err > 0 ? 0 : err;
}
int bt_vcp_vol_set(struct bt_vcp *vcp, uint8_t volume)
int bt_vcp_vol_rend_set_vol(struct bt_vcp *vcp, uint8_t volume)
{
const struct vcs_control_vol cp = {
@ -535,7 +536,7 @@ int bt_vcp_vol_set(struct bt_vcp *vcp, uint8_t volume)
return err > 0 ? 0 : err;
}
int bt_vcp_unmute(struct bt_vcp *vcp)
int bt_vcp_vol_rend_unmute(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_UNMUTE,
@ -553,7 +554,7 @@ int bt_vcp_unmute(struct bt_vcp *vcp)
return err > 0 ? 0 : err;
}
int bt_vcp_mute(struct bt_vcp *vcp)
int bt_vcp_vol_rend_mute(struct bt_vcp *vcp)
{
const struct vcs_control cp = {
.opcode = BT_VCP_OPCODE_MUTE,

View file

@ -26,8 +26,8 @@ zephyr_library_sources_ifdef(
iso.c
)
zephyr_library_sources_ifdef(
CONFIG_BT_VCP
vcp.c
CONFIG_BT_VCP_VOL_REND
vcp_vol_rend.c
)
zephyr_library_sources_ifdef(
CONFIG_BT_VCP_VOL_CTLR

View file

@ -2005,7 +2005,7 @@ ssize_t audio_ad_data_add(struct bt_data *data_array, const size_t data_array_si
IF_ENABLED(CONFIG_BT_PACS, (BT_UUID_16_ENCODE(BT_UUID_PACS_VAL),))
IF_ENABLED(CONFIG_BT_GTBS, (BT_UUID_16_ENCODE(BT_UUID_GTBS_VAL),))
IF_ENABLED(CONFIG_BT_TBS, (BT_UUID_16_ENCODE(BT_UUID_TBS_VAL),))
IF_ENABLED(CONFIG_BT_VCP, (BT_UUID_16_ENCODE(BT_UUID_VCS_VAL),))
IF_ENABLED(CONFIG_BT_VCP_VOL_REND, (BT_UUID_16_ENCODE(BT_UUID_VCS_VAL),))
IF_ENABLED(CONFIG_BT_HAS, (BT_UUID_16_ENCODE(BT_UUID_HAS_VAL),))
};
size_t ad_len = 0;

View file

@ -20,7 +20,7 @@
static struct bt_vcp *vcp;
static struct bt_vcp_included vcp_included;
static void vcs_state_cb(struct bt_vcp *vcp, int err, uint8_t volume,
static void vcp_vol_rend_state_cb(struct bt_vcp *vcp, int err, uint8_t volume,
uint8_t mute)
{
if (err) {
@ -30,7 +30,7 @@ static void vcs_state_cb(struct bt_vcp *vcp, int err, uint8_t volume,
}
}
static void vcs_flags_cb(struct bt_vcp *vcp, int err, uint8_t flags)
static void vcp_vol_rend_flags_cb(struct bt_vcp *vcp, int err, uint8_t flags)
{
if (err) {
shell_error(ctx_shell, "VCP flags get failed (%d)", err);
@ -139,9 +139,9 @@ static void vocs_description_cb(struct bt_vocs *inst, int err,
}
}
static struct bt_vcp_cb vcs_cbs = {
.state = vcs_state_cb,
.flags = vcs_flags_cb,
static struct bt_vcp_cb vcp_vol_rend_cbs = {
.state = vcp_vol_rend_state_cb,
.flags = vcp_vol_rend_flags_cb,
};
static struct bt_aics_cb aics_cbs = {
@ -158,47 +158,48 @@ static struct bt_vocs_cb vocs_cbs = {
.description = vocs_description_cb
};
static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_vol_rend_init(const struct shell *sh, size_t argc,
char **argv)
{
int result = 0;
struct bt_vcp_register_param vcs_param;
char input_desc[CONFIG_BT_VCP_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOCS_INSTANCE_COUNT][16];
struct bt_vcp_vol_rend_register_param vcp_register_param;
char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT][16];
static const char assignment_operator[] = "=";
if (!ctx_shell) {
ctx_shell = sh;
}
memset(&vcs_param, 0, sizeof(vcs_param));
memset(&vcp_register_param, 0, sizeof(vcp_register_param));
for (int i = 0; i < ARRAY_SIZE(vcs_param.vocs_param); i++) {
vcs_param.vocs_param[i].location_writable = true;
vcs_param.vocs_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.vocs_param); i++) {
vcp_register_param.vocs_param[i].location_writable = true;
vcp_register_param.vocs_param[i].desc_writable = true;
snprintf(output_desc[i], sizeof(output_desc[i]),
"Output %d", i + 1);
vcs_param.vocs_param[i].output_desc = output_desc[i];
vcs_param.vocs_param[i].cb = &vocs_cbs;
vcp_register_param.vocs_param[i].output_desc = output_desc[i];
vcp_register_param.vocs_param[i].cb = &vocs_cbs;
}
for (int i = 0; i < ARRAY_SIZE(vcs_param.aics_param); i++) {
vcs_param.aics_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.aics_param); i++) {
vcp_register_param.aics_param[i].desc_writable = true;
snprintf(input_desc[i], sizeof(input_desc[i]),
"Input %d", i + 1);
vcs_param.aics_param[i].description = input_desc[i];
vcs_param.aics_param[i].type = BT_AICS_INPUT_TYPE_UNSPECIFIED;
vcs_param.aics_param[i].status = true;
vcs_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcs_param.aics_param[i].units = 1;
vcs_param.aics_param[i].min_gain = -100;
vcs_param.aics_param[i].max_gain = 100;
vcs_param.aics_param[i].cb = &aics_cbs;
vcp_register_param.aics_param[i].description = input_desc[i];
vcp_register_param.aics_param[i].type = BT_AICS_INPUT_TYPE_UNSPECIFIED;
vcp_register_param.aics_param[i].status = true;
vcp_register_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcp_register_param.aics_param[i].units = 1;
vcp_register_param.aics_param[i].min_gain = -100;
vcp_register_param.aics_param[i].max_gain = 100;
vcp_register_param.aics_param[i].cb = &aics_cbs;
}
/* Default values */
vcs_param.step = 1;
vcs_param.mute = BT_VCP_STATE_UNMUTED;
vcs_param.volume = 100;
vcp_register_param.step = 1;
vcp_register_param.mute = BT_VCP_STATE_UNMUTED;
vcp_register_param.volume = 100;
for (int i = 1; i < argc; i++) {
const char *operator = strstr(argv[i], assignment_operator);
@ -206,11 +207,11 @@ static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
if (kwarg) {
if (!strncmp(argv[i], "step", 4)) {
vcs_param.step = shell_strtoul(kwarg, 10, &result);
vcp_register_param.step = shell_strtoul(kwarg, 10, &result);
} else if (!strncmp(argv[i], "mute", 4)) {
vcs_param.mute = shell_strtobool(kwarg, 10, &result);
vcp_register_param.mute = shell_strtobool(kwarg, 10, &result);
} else if (!strncmp(argv[i], "volume", 6)) {
vcs_param.volume = shell_strtoul(kwarg, 10, &result);
vcp_register_param.volume = shell_strtoul(kwarg, 10, &result);
} else {
shell_help(sh);
return SHELL_CMD_HELP_PRINTED;
@ -226,15 +227,15 @@ static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
}
}
vcs_param.cb = &vcs_cbs;
vcp_register_param.cb = &vcp_vol_rend_cbs;
result = bt_vcp_register(&vcs_param, &vcp);
result = bt_vcp_vol_rend_register(&vcp_register_param, &vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
return result;
}
result = bt_vcp_included_get(vcp, &vcp_included);
result = bt_vcp_vol_rend_included_get(vcp, &vcp_included);
if (result != 0) {
shell_error(sh, "Failed to get included services: %d", result);
return result;
@ -243,7 +244,7 @@ static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
return result;
}
static int cmd_vcs_volume_step(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_volume_step(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -255,7 +256,7 @@ static int cmd_vcs_volume_step(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcp_vol_step_set(step);
result = bt_vcp_vol_rend_set_step(step);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -263,10 +264,10 @@ static int cmd_vcs_volume_step(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_state_get(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_state_get(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_vol_get(vcp);
int result = bt_vcp_vol_rend_get_state(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -275,10 +276,10 @@ static int cmd_vcs_state_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_flags_get(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_flags_get(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_flags_get(vcp);
int result = bt_vcp_vol_rend_get_flags(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -287,10 +288,10 @@ static int cmd_vcs_flags_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_volume_down(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_volume_down(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_vol_down(vcp);
int result = bt_vcp_vol_rend_vol_down(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -299,11 +300,11 @@ static int cmd_vcs_volume_down(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_volume_up(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_volume_up(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_vol_up(vcp);
int result = bt_vcp_vol_rend_vol_up(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -312,10 +313,10 @@ static int cmd_vcs_volume_up(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_unmute_volume_down(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_unmute_volume_down(const struct shell *sh,
size_t argc, char **argv)
{
int result = bt_vcp_unmute_vol_down(vcp);
int result = bt_vcp_vol_rend_unmute_vol_down(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -324,10 +325,10 @@ static int cmd_vcs_unmute_volume_down(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_unmute_volume_up(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_unmute_volume_up(const struct shell *sh,
size_t argc, char **argv)
{
int result = bt_vcp_unmute_vol_up(vcp);
int result = bt_vcp_vol_rend_unmute_vol_up(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -336,7 +337,7 @@ static int cmd_vcs_unmute_volume_up(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_volume_set(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_volume_set(const struct shell *sh, size_t argc,
char **argv)
{
@ -348,7 +349,7 @@ static int cmd_vcs_volume_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcp_vol_set(vcp, volume);
result = bt_vcp_vol_rend_set_vol(vcp, volume);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -356,9 +357,10 @@ static int cmd_vcs_volume_set(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_unmute(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_vol_rend_unmute(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_unmute(vcp);
int result = bt_vcp_vol_rend_unmute(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -367,9 +369,10 @@ static int cmd_vcs_unmute(const struct shell *sh, size_t argc, char **argv)
return result;
}
static int cmd_vcs_mute(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_vol_rend_mute(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcp_mute(vcp);
int result = bt_vcp_vol_rend_mute(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -378,7 +381,7 @@ static int cmd_vcs_mute(const struct shell *sh, size_t argc, char **argv)
return result;
}
static int cmd_vcs_vocs_state_get(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_vocs_state_get(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -386,9 +389,9 @@ static int cmd_vcs_vocs_state_get(const struct shell *sh, size_t argc,
/* TODO: For here, and the following VOCS and AICS, default index to 0 */
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -400,15 +403,15 @@ static int cmd_vcs_vocs_state_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_vocs_location_get(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_vocs_location_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -420,16 +423,16 @@ static int cmd_vcs_vocs_location_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_vocs_location_set(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_vocs_location_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
int location = strtol(argv[2], NULL, 0);
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
if (location > UINT16_MAX || location < 0) {
@ -448,16 +451,16 @@ static int cmd_vcs_vocs_location_set(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_vocs_offset_set(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_vocs_offset_set(const struct shell *sh, size_t argc,
char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
int offset = strtol(argv[2], NULL, 0);
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -475,15 +478,16 @@ static int cmd_vcs_vocs_offset_set(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_vocs_output_description_get(const struct shell *sh,
size_t argc, char **argv)
static int cmd_vcp_vol_rend_vocs_output_description_get(const struct shell *sh,
size_t argc,
char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -495,16 +499,17 @@ static int cmd_vcs_vocs_output_description_get(const struct shell *sh,
return result;
}
static int cmd_vcs_vocs_output_description_set(const struct shell *sh,
size_t argc, char **argv)
static int cmd_vcp_vol_rend_vocs_output_description_set(const struct shell *sh,
size_t argc,
char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
char *description = argv[2];
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -517,8 +522,8 @@ static int cmd_vcs_vocs_output_description_set(const struct shell *sh,
return result;
}
static int cmd_vcs_aics_input_state_get(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_aics_input_state_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -537,8 +542,8 @@ static int cmd_vcs_aics_input_state_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_gain_setting_get(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_aics_gain_setting_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -557,8 +562,8 @@ static int cmd_vcs_aics_gain_setting_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_input_type_get(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_aics_input_type_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -577,8 +582,8 @@ static int cmd_vcs_aics_input_type_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_input_status_get(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_aics_input_status_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -597,8 +602,8 @@ static int cmd_vcs_aics_input_status_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_input_unmute(const struct shell *sh, size_t argc,
char **argv)
static int cmd_vcp_vol_rend_aics_input_unmute(const struct shell *sh,
size_t argc, char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -617,7 +622,7 @@ static int cmd_vcs_aics_input_unmute(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_input_mute(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_aics_input_mute(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -637,8 +642,9 @@ static int cmd_vcs_aics_input_mute(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_manual_input_gain_set(const struct shell *sh,
size_t argc, char **argv)
static int cmd_vcp_vol_rend_aics_manual_input_gain_set(const struct shell *sh,
size_t argc,
char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -657,8 +663,9 @@ static int cmd_vcs_aics_manual_input_gain_set(const struct shell *sh,
return result;
}
static int cmd_vcs_aics_automatic_input_gain_set(const struct shell *sh,
size_t argc, char **argv)
static int cmd_vcp_vol_rend_aics_auto_input_gain_set(const struct shell *sh,
size_t argc,
char **argv)
{
int result;
int index = strtol(argv[1], NULL, 0);
@ -677,7 +684,7 @@ static int cmd_vcs_aics_automatic_input_gain_set(const struct shell *sh,
return result;
}
static int cmd_vcs_aics_gain_set(const struct shell *sh, size_t argc,
static int cmd_vcp_vol_rend_aics_gain_set(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -704,7 +711,7 @@ static int cmd_vcs_aics_gain_set(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_aics_input_description_get(const struct shell *sh,
static int cmd_vcp_vol_rend_aics_input_description_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -724,7 +731,7 @@ static int cmd_vcs_aics_input_description_get(const struct shell *sh,
return result;
}
static int cmd_vcs_aics_input_description_set(const struct shell *sh,
static int cmd_vcp_vol_rend_aics_input_description_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -746,7 +753,7 @@ static int cmd_vcs_aics_input_description_set(const struct shell *sh,
return result;
}
static int cmd_vcs(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_vol_rend(const struct shell *sh, size_t argc, char **argv)
{
if (argc > 1) {
shell_error(sh, "%s unknown parameter: %s",
@ -758,104 +765,105 @@ static int cmd_vcs(const struct shell *sh, size_t argc, char **argv)
return -ENOEXEC;
}
SHELL_STATIC_SUBCMD_SET_CREATE(vcs_cmds,
SHELL_STATIC_SUBCMD_SET_CREATE(vcp_vol_rend_cmds,
SHELL_CMD_ARG(init, NULL,
"Initialize the service and register callbacks "
"[step=<uint>] [mute=<bool>] [volume=<uint>]",
cmd_vcs_init, 1, 3),
cmd_vcp_vol_rend_init, 1, 3),
SHELL_CMD_ARG(state_get, NULL,
"Get volume state of the VCP server. Should be done "
"before sending any control messages",
cmd_vcs_state_get, 1, 0),
cmd_vcp_vol_rend_state_get, 1, 0),
SHELL_CMD_ARG(flags_get, NULL,
"Read volume flags",
cmd_vcs_flags_get, 1, 0),
cmd_vcp_vol_rend_flags_get, 1, 0),
SHELL_CMD_ARG(volume_down, NULL,
"Turn the volume down",
cmd_vcs_volume_down, 1, 0),
cmd_vcp_vol_rend_volume_down, 1, 0),
SHELL_CMD_ARG(volume_up, NULL,
"Turn the volume up",
cmd_vcs_volume_up, 1, 0),
cmd_vcp_vol_rend_volume_up, 1, 0),
SHELL_CMD_ARG(unmute_volume_down, NULL,
"Turn the volume down, and unmute",
cmd_vcs_unmute_volume_down, 1, 0),
cmd_vcp_vol_rend_unmute_volume_down, 1, 0),
SHELL_CMD_ARG(unmute_volume_up, NULL,
"Turn the volume up, and unmute",
cmd_vcs_unmute_volume_up, 1, 0),
cmd_vcp_vol_rend_unmute_volume_up, 1, 0),
SHELL_CMD_ARG(volume_set, NULL,
"Set an absolute volume <volume>",
cmd_vcs_volume_set, 2, 0),
cmd_vcp_vol_rend_volume_set, 2, 0),
SHELL_CMD_ARG(unmute, NULL,
"Unmute",
cmd_vcs_unmute, 1, 0),
cmd_vcp_vol_rend_unmute, 1, 0),
SHELL_CMD_ARG(mute, NULL,
"Mute",
cmd_vcs_mute, 1, 0),
cmd_vcp_vol_rend_mute, 1, 0),
SHELL_CMD_ARG(step, NULL,
"Set step size",
cmd_vcs_volume_step, 2, 0),
cmd_vcp_vol_rend_volume_step, 2, 0),
SHELL_CMD_ARG(vocs_state_get, NULL,
"Get the offset state of a VOCS instance <inst_index>",
cmd_vcs_vocs_state_get, 2, 0),
cmd_vcp_vol_rend_vocs_state_get, 2, 0),
SHELL_CMD_ARG(vocs_location_get, NULL,
"Get the location of a VOCS instance <inst_index>",
cmd_vcs_vocs_location_get, 2, 0),
cmd_vcp_vol_rend_vocs_location_get, 2, 0),
SHELL_CMD_ARG(vocs_location_set, NULL,
"Set the location of a VOCS instance <inst_index> "
"<location>",
cmd_vcs_vocs_location_set, 3, 0),
cmd_vcp_vol_rend_vocs_location_set, 3, 0),
SHELL_CMD_ARG(vocs_offset_set, NULL,
"Set the offset for a VOCS instance <inst_index> "
"<offset>",
cmd_vcs_vocs_offset_set, 3, 0),
cmd_vcp_vol_rend_vocs_offset_set, 3, 0),
SHELL_CMD_ARG(vocs_output_description_get, NULL,
"Get the output description of a VOCS instance "
"<inst_index>",
cmd_vcs_vocs_output_description_get, 2, 0),
cmd_vcp_vol_rend_vocs_output_description_get, 2, 0),
SHELL_CMD_ARG(vocs_output_description_set, NULL,
"Set the output description of a VOCS instance "
"<inst_index> <description>",
cmd_vcs_vocs_output_description_set, 3, 0),
cmd_vcp_vol_rend_vocs_output_description_set, 3, 0),
SHELL_CMD_ARG(aics_input_state_get, NULL,
"Get the input state of a AICS instance <inst_index>",
cmd_vcs_aics_input_state_get, 2, 0),
cmd_vcp_vol_rend_aics_input_state_get, 2, 0),
SHELL_CMD_ARG(aics_gain_setting_get, NULL,
"Get the gain settings of a AICS instance <inst_index>",
cmd_vcs_aics_gain_setting_get, 2, 0),
cmd_vcp_vol_rend_aics_gain_setting_get, 2, 0),
SHELL_CMD_ARG(aics_input_type_get, NULL,
"Get the input type of a AICS instance <inst_index>",
cmd_vcs_aics_input_type_get, 2, 0),
cmd_vcp_vol_rend_aics_input_type_get, 2, 0),
SHELL_CMD_ARG(aics_input_status_get, NULL,
"Get the input status of a AICS instance <inst_index>",
cmd_vcs_aics_input_status_get, 2, 0),
cmd_vcp_vol_rend_aics_input_status_get, 2, 0),
SHELL_CMD_ARG(aics_input_unmute, NULL,
"Unmute the input of a AICS instance <inst_index>",
cmd_vcs_aics_input_unmute, 2, 0),
cmd_vcp_vol_rend_aics_input_unmute, 2, 0),
SHELL_CMD_ARG(aics_input_mute, NULL,
"Mute the input of a AICS instance <inst_index>",
cmd_vcs_aics_input_mute, 2, 0),
cmd_vcp_vol_rend_aics_input_mute, 2, 0),
SHELL_CMD_ARG(aics_manual_input_gain_set, NULL,
"Set the gain mode of a AICS instance to manual "
"<inst_index>",
cmd_vcs_aics_manual_input_gain_set, 2, 0),
cmd_vcp_vol_rend_aics_manual_input_gain_set, 2, 0),
SHELL_CMD_ARG(aics_automatic_input_gain_set, NULL,
"Set the gain mode of a AICS instance to automatic "
"<inst_index>",
cmd_vcs_aics_automatic_input_gain_set, 2, 0),
cmd_vcp_vol_rend_aics_auto_input_gain_set, 2, 0),
SHELL_CMD_ARG(aics_gain_set, NULL,
"Set the gain in dB of a AICS instance <inst_index> "
"<gain (-128 to 127)>",
cmd_vcs_aics_gain_set, 3, 0),
cmd_vcp_vol_rend_aics_gain_set, 3, 0),
SHELL_CMD_ARG(aics_input_description_get, NULL,
"Read the input description of a AICS instance "
"<inst_index>",
cmd_vcs_aics_input_description_get, 2, 0),
cmd_vcp_vol_rend_aics_input_description_get, 2, 0),
SHELL_CMD_ARG(aics_input_description_set, NULL,
"Set the input description of a AICS instance "
"<inst_index> <description>",
cmd_vcs_aics_input_description_set, 3, 0),
cmd_vcp_vol_rend_aics_input_description_set, 3, 0),
SHELL_SUBCMD_SET_END
);
SHELL_CMD_ARG_REGISTER(vcp, &vcs_cmds, "Bluetooth VCP shell commands",
cmd_vcs, 1, 1);
SHELL_CMD_ARG_REGISTER(vcp_vol_rend, &vcp_vol_rend_cmds,
"Bluetooth VCP Volume Renderer shell commands",
cmd_vcp_vol_rend, 1, 1);

View file

@ -47,9 +47,9 @@ CONFIG_BT_AICS_MAX_INSTANCE_COUNT=4
CONFIG_BT_AICS_CLIENT_MAX_INSTANCE_COUNT=4
#Volume Control
CONFIG_BT_VCP=y
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=2
CONFIG_BT_VCP_AICS_INSTANCE_COUNT=2
CONFIG_BT_VCP_VOL_REND=y
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=2
CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT=2
CONFIG_BT_VCP_VOL_CTLR=y
CONFIG_BT_VCP_VOL_CTLR_MAX_VOCS_INST=2
CONFIG_BT_VCP_VOL_CTLR_MAX_AICS_INST=2
@ -116,7 +116,7 @@ CONFIG_BT_CAP_INITIATOR=y
# DEBUGGING
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_VCS_LOG_LEVEL_DBG=y
CONFIG_BT_VCP_VOL_REND_LOG_LEVEL_DBG=y
CONFIG_BT_VCP_VOL_CTLR_LOG_LEVEL_DBG=y
CONFIG_BT_AICS_LOG_LEVEL_DBG=y
CONFIG_BT_AICS_CLIENT_LOG_LEVEL_DBG=y

View file

@ -575,10 +575,10 @@ static void test_main(void)
return;
}
printk("Getting VCP client conn\n");
printk("Getting VCP volume controller conn\n");
err = bt_vcp_vol_ctlr_conn_get(vcp, &cached_conn);
if (err != 0) {
FAIL("Could not get VCP client conn (err %d)\n", err);
FAIL("Could not get VCP volume controller conn (err %d)\n", err);
return;
}
if (cached_conn != default_conn) {
@ -720,7 +720,7 @@ static void test_main(void)
}
}
PASS("VCP client Passed\n");
PASS("VCP volume controller Passed\n");
}
static const struct bst_test_instance test_vcs[] = {

View file

@ -5,7 +5,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#ifdef CONFIG_BT_VCP
#ifdef CONFIG_BT_VCP_VOL_REND
#include <zephyr/bluetooth/audio/vcp.h>
#include "common.h"
@ -434,9 +434,9 @@ static int test_vocs_standalone(void)
static void test_standalone(void)
{
int err;
struct bt_vcp_register_param vcs_param;
char input_desc[CONFIG_BT_VCP_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOCS_INSTANCE_COUNT][16];
struct bt_vcp_vol_rend_register_param vcp_register_param;
char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT][16];
const uint8_t volume_step = 5;
uint8_t expected_volume;
uint8_t expected_mute;
@ -449,43 +449,43 @@ static void test_standalone(void)
printk("Bluetooth initialized\n");
memset(&vcs_param, 0, sizeof(vcs_param));
memset(&vcp_register_param, 0, sizeof(vcp_register_param));
for (int i = 0; i < ARRAY_SIZE(vcs_param.vocs_param); i++) {
vcs_param.vocs_param[i].location_writable = true;
vcs_param.vocs_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.vocs_param); i++) {
vcp_register_param.vocs_param[i].location_writable = true;
vcp_register_param.vocs_param[i].desc_writable = true;
snprintf(output_desc[i], sizeof(output_desc[i]),
"Output %d", i + 1);
vcs_param.vocs_param[i].output_desc = output_desc[i];
vcs_param.vocs_param[i].cb = &vocs_cb;
vcp_register_param.vocs_param[i].output_desc = output_desc[i];
vcp_register_param.vocs_param[i].cb = &vocs_cb;
}
for (int i = 0; i < ARRAY_SIZE(vcs_param.aics_param); i++) {
vcs_param.aics_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.aics_param); i++) {
vcp_register_param.aics_param[i].desc_writable = true;
snprintf(input_desc[i], sizeof(input_desc[i]),
"Input %d", i + 1);
vcs_param.aics_param[i].description = input_desc[i];
vcs_param.aics_param[i].type = BT_AICS_INPUT_TYPE_DIGITAL;
vcs_param.aics_param[i].status = g_aics_active;
vcs_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcs_param.aics_param[i].units = 1;
vcs_param.aics_param[i].min_gain = 0;
vcs_param.aics_param[i].max_gain = 100;
vcs_param.aics_param[i].cb = &aics_cb;
vcp_register_param.aics_param[i].description = input_desc[i];
vcp_register_param.aics_param[i].type = BT_AICS_INPUT_TYPE_DIGITAL;
vcp_register_param.aics_param[i].status = g_aics_active;
vcp_register_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcp_register_param.aics_param[i].units = 1;
vcp_register_param.aics_param[i].min_gain = 0;
vcp_register_param.aics_param[i].max_gain = 100;
vcp_register_param.aics_param[i].cb = &aics_cb;
}
vcs_param.step = 1;
vcs_param.mute = BT_VCP_STATE_UNMUTED;
vcs_param.volume = 100;
vcs_param.cb = &vcs_cb;
vcp_register_param.step = 1;
vcp_register_param.mute = BT_VCP_STATE_UNMUTED;
vcp_register_param.volume = 100;
vcp_register_param.cb = &vcs_cb;
err = bt_vcp_register(&vcs_param, &vcp);
err = bt_vcp_vol_rend_register(&vcp_register_param, &vcp);
if (err) {
FAIL("VCP register failed (err %d)\n", err);
return;
}
err = bt_vcp_included_get(vcp, &vcp_included);
err = bt_vcp_vol_rend_included_get(vcp, &vcp_included);
if (err) {
FAIL("VCP included get failed (err %d)\n", err);
return;
@ -495,7 +495,7 @@ static void test_standalone(void)
printk("Setting VCP step\n");
err = bt_vcp_vol_step_set(volume_step);
err = bt_vcp_vol_rend_set_step(volume_step);
if (err) {
FAIL("VCP step set failed (err %d)\n", err);
return;
@ -504,7 +504,7 @@ static void test_standalone(void)
printk("Getting VCP volume state\n");
g_cb = false;
err = bt_vcp_vol_get(vcp);
err = bt_vcp_vol_rend_get_state(vcp);
if (err) {
FAIL("Could not get VCP volume (err %d)\n", err);
return;
@ -514,7 +514,7 @@ static void test_standalone(void)
printk("Getting VCP flags\n");
g_cb = false;
err = bt_vcp_flags_get(vcp);
err = bt_vcp_vol_rend_get_flags(vcp);
if (err) {
FAIL("Could not get VCP flags (err %d)\n", err);
return;
@ -524,7 +524,7 @@ static void test_standalone(void)
printk("Downing VCP volume\n");
expected_volume = g_volume - volume_step;
err = bt_vcp_vol_down(vcp);
err = bt_vcp_vol_rend_vol_down(vcp);
if (err) {
FAIL("Could not get down VCP volume (err %d)\n", err);
return;
@ -534,7 +534,7 @@ static void test_standalone(void)
printk("Upping VCP volume\n");
expected_volume = g_volume + volume_step;
err = bt_vcp_vol_up(vcp);
err = bt_vcp_vol_rend_vol_up(vcp);
if (err) {
FAIL("Could not up VCP volume (err %d)\n", err);
return;
@ -544,7 +544,7 @@ static void test_standalone(void)
printk("Muting VCP\n");
expected_mute = 1;
err = bt_vcp_mute(vcp);
err = bt_vcp_vol_rend_mute(vcp);
if (err) {
FAIL("Could not mute VCP (err %d)\n", err);
return;
@ -555,7 +555,7 @@ static void test_standalone(void)
printk("Downing and unmuting VCP\n");
expected_volume = g_volume - volume_step;
expected_mute = 0;
err = bt_vcp_unmute_vol_down(vcp);
err = bt_vcp_vol_rend_unmute_vol_down(vcp);
if (err) {
FAIL("Could not down and unmute VCP (err %d)\n", err);
return;
@ -566,7 +566,7 @@ static void test_standalone(void)
printk("Muting VCP\n");
expected_mute = 1;
err = bt_vcp_mute(vcp);
err = bt_vcp_vol_rend_mute(vcp);
if (err) {
FAIL("Could not mute VCP (err %d)\n", err);
return;
@ -577,7 +577,7 @@ static void test_standalone(void)
printk("Upping and unmuting VCP\n");
expected_volume = g_volume + volume_step;
expected_mute = 0;
err = bt_vcp_unmute_vol_up(vcp);
err = bt_vcp_vol_rend_unmute_vol_up(vcp);
if (err) {
FAIL("Could not up and unmute VCP (err %d)\n", err);
return;
@ -588,7 +588,7 @@ static void test_standalone(void)
printk("Muting VCP\n");
expected_mute = 1;
err = bt_vcp_mute(vcp);
err = bt_vcp_vol_rend_mute(vcp);
if (err) {
FAIL("Could not mute VCP (err %d)\n", err);
return;
@ -598,7 +598,7 @@ static void test_standalone(void)
printk("Unmuting VCP\n");
expected_mute = 0;
err = bt_vcp_unmute(vcp);
err = bt_vcp_vol_rend_unmute(vcp);
if (err) {
FAIL("Could not unmute VCP (err %d)\n", err);
return;
@ -607,7 +607,7 @@ static void test_standalone(void)
printk("VCP volume unmuted\n");
expected_volume = g_volume - 5;
err = bt_vcp_vol_set(vcp, expected_volume);
err = bt_vcp_vol_rend_set_vol(vcp, expected_volume);
if (err) {
FAIL("Could not set VCP volume (err %d)\n", err);
return;
@ -615,13 +615,13 @@ static void test_standalone(void)
WAIT_FOR_COND(expected_volume == g_volume);
printk("VCP volume set\n");
if (CONFIG_BT_VCP_VOCS_INSTANCE_COUNT > 0) {
if (CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT > 0) {
if (test_vocs_standalone()) {
return;
}
}
if (CONFIG_BT_VCP_AICS_INSTANCE_COUNT > 0) {
if (CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT > 0) {
if (test_aics_standalone()) {
return;
}
@ -633,9 +633,9 @@ static void test_standalone(void)
static void test_main(void)
{
int err;
struct bt_vcp_register_param vcs_param;
char input_desc[CONFIG_BT_VCP_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOCS_INSTANCE_COUNT][16];
struct bt_vcp_vol_rend_register_param vcp_register_param;
char input_desc[CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT][16];
err = bt_enable(NULL);
if (err) {
@ -645,43 +645,43 @@ static void test_main(void)
printk("Bluetooth initialized\n");
memset(&vcs_param, 0, sizeof(vcs_param));
memset(&vcp_register_param, 0, sizeof(vcp_register_param));
for (int i = 0; i < ARRAY_SIZE(vcs_param.vocs_param); i++) {
vcs_param.vocs_param[i].location_writable = true;
vcs_param.vocs_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.vocs_param); i++) {
vcp_register_param.vocs_param[i].location_writable = true;
vcp_register_param.vocs_param[i].desc_writable = true;
snprintf(output_desc[i], sizeof(output_desc[i]),
"Output %d", i + 1);
vcs_param.vocs_param[i].output_desc = output_desc[i];
vcs_param.vocs_param[i].cb = &vocs_cb;
vcp_register_param.vocs_param[i].output_desc = output_desc[i];
vcp_register_param.vocs_param[i].cb = &vocs_cb;
}
for (int i = 0; i < ARRAY_SIZE(vcs_param.aics_param); i++) {
vcs_param.aics_param[i].desc_writable = true;
for (int i = 0; i < ARRAY_SIZE(vcp_register_param.aics_param); i++) {
vcp_register_param.aics_param[i].desc_writable = true;
snprintf(input_desc[i], sizeof(input_desc[i]),
"Input %d", i + 1);
vcs_param.aics_param[i].description = input_desc[i];
vcs_param.aics_param[i].type = BT_AICS_INPUT_TYPE_DIGITAL;
vcs_param.aics_param[i].status = g_aics_active;
vcs_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcs_param.aics_param[i].units = 1;
vcs_param.aics_param[i].min_gain = 0;
vcs_param.aics_param[i].max_gain = 100;
vcs_param.aics_param[i].cb = &aics_cb;
vcp_register_param.aics_param[i].description = input_desc[i];
vcp_register_param.aics_param[i].type = BT_AICS_INPUT_TYPE_DIGITAL;
vcp_register_param.aics_param[i].status = g_aics_active;
vcp_register_param.aics_param[i].gain_mode = BT_AICS_MODE_MANUAL;
vcp_register_param.aics_param[i].units = 1;
vcp_register_param.aics_param[i].min_gain = 0;
vcp_register_param.aics_param[i].max_gain = 100;
vcp_register_param.aics_param[i].cb = &aics_cb;
}
vcs_param.step = 1;
vcs_param.mute = BT_VCP_STATE_UNMUTED;
vcs_param.volume = 100;
vcs_param.cb = &vcs_cb;
vcp_register_param.step = 1;
vcp_register_param.mute = BT_VCP_STATE_UNMUTED;
vcp_register_param.volume = 100;
vcp_register_param.cb = &vcs_cb;
err = bt_vcp_register(&vcs_param, &vcp);
err = bt_vcp_vol_rend_register(&vcp_register_param, &vcp);
if (err) {
FAIL("VCP register failed (err %d)\n", err);
return;
}
err = bt_vcp_included_get(vcp, &vcp_included);
err = bt_vcp_vol_rend_included_get(vcp, &vcp_included);
if (err) {
FAIL("VCP included get failed (err %d)\n", err);
return;
@ -699,18 +699,18 @@ static void test_main(void)
WAIT_FOR_COND(g_is_connected);
PASS("VCP passed\n");
PASS("VCP volume renderer passed\n");
}
static const struct bst_test_instance test_vcs[] = {
{
.test_id = "vcs_standalone",
.test_id = "vcp_vol_rend_standalone",
.test_post_init_f = test_init,
.test_tick_f = test_tick,
.test_main_f = test_standalone
},
{
.test_id = "vcp",
.test_id = "vcp_vol_rend",
.test_post_init_f = test_init,
.test_tick_f = test_tick,
.test_main_f = test_main
@ -728,4 +728,4 @@ struct bst_test_list *test_vcp_install(struct bst_test_list *tests)
return tests;
}
#endif /* CONFIG_BT_VCP */
#endif /* CONFIG_BT_VCP_VOL_REND */

View file

@ -24,10 +24,11 @@ BOARD="${BOARD:-nrf52_bsim}"
cd ${BSIM_OUT_PATH}/bin
printf "\n\n======== Running VCP standalone (API) test =========\n\n"
printf "\n\n======== Running VCP Volume Renderer standalone (API) test =========\n\n"
Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_audio_prj_conf \
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=vcs_standalone -rs=23
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0
-testid=vcp_vol_rend_standalone -rs=23
# Simulation time should be larger than the WAIT_TIME in common.h
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
@ -37,10 +38,10 @@ for PROCESS_ID in $PROCESS_IDS; do
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
printf "\n\n======== Running VCP and VCP client test =========\n\n"
printf "\n\n======== Running VCP Volume Renderer and VCP Volume Controller test =========\n\n"
Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_audio_prj_conf \
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=vcp -rs=23
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=vcp_vol_rend -rs=23
Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_audio_prj_conf \
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=vcp_vol_ctlr -rs=46

View file

@ -70,9 +70,9 @@ CONFIG_BT_VOCS_CLIENT_MAX_INSTANCE_COUNT=1
CONFIG_BT_AICS_MAX_INSTANCE_COUNT=2
CONFIG_BT_AICS_CLIENT_MAX_INSTANCE_COUNT=2
CONFIG_BT_VCP=y
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=1
CONFIG_BT_VCP_AICS_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_REND=y
CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_CTLR=y
CONFIG_BT_VCP_VOL_CTLR_MAX_VOCS_INST=1
CONFIG_BT_VCP_VOL_CTLR_MAX_AICS_INST=1
@ -154,7 +154,7 @@ CONFIG_BT_HAS_LOG_LEVEL_DBG=y
CONFIG_BT_HAS_CLIENT_LOG_LEVEL_DBG=y
CONFIG_BT_TBS_LOG_LEVEL_DBG=y
CONFIG_BT_VCP_VOL_CTLR_LOG_LEVEL_DBG=y
CONFIG_BT_VCP_LOG_LEVEL_DBG=y
CONFIG_BT_VCP_VOL_REND_LOG_LEVEL_DBG=y
CONFIG_BT_MICP_MIC_CTLR_LOG_LEVEL_DBG=y
CONFIG_BT_MICP_MIC_DEV_LOG_LEVEL_DBG=y
CONFIG_BT_AICS_CLIENT_LOG_LEVEL_DBG=y

View file

@ -46,7 +46,7 @@ tests:
build_only: true
platform_allow: native_posix
extra_configs:
- CONFIG_BT_VCP=n
- CONFIG_BT_VCP_VOL_REND=n
tags: bluetooth
bluetooth.shell.audio.no_vocs:
extra_args: CONF_FILE="audio.conf"
@ -54,7 +54,7 @@ tests:
platform_allow: native_posix
extra_configs:
- CONFIG_BT_VOCS_MAX_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=0
tags: bluetooth
bluetooth.shell.audio.no_aics:
extra_args: CONF_FILE="audio.conf"
@ -62,7 +62,7 @@ tests:
platform_allow: native_posix
extra_configs:
- CONFIG_BT_AICS_MAX_INSTANCE_COUNT=0
- CONFIG_BT_VCP_AICS_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT=0
- CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT=0
tags: bluetooth
bluetooth.shell.audio.no_aics_vocs:
@ -71,9 +71,9 @@ tests:
platform_allow: native_posix
extra_configs:
- CONFIG_BT_VOCS_MAX_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOCS_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT=0
- CONFIG_BT_AICS_MAX_INSTANCE_COUNT=0
- CONFIG_BT_VCP_AICS_INSTANCE_COUNT=0
- CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT=0
- CONFIG_BT_MICP_MIC_DEV_AICS_INSTANCE_COUNT=0
tags: bluetooth
bluetooth.shell.audio.no_vcp_vol_ctlr:
@ -88,7 +88,7 @@ tests:
build_only: true
platform_allow: native_posix
extra_configs:
- CONFIG_BT_VCP=n
- CONFIG_BT_VCP_VOL_REND=n
- CONFIG_BT_VCP_VOL_CTLR=n
tags: bluetooth
bluetooth.shell.audio.vcp_vol_ctlr_no_aics_client: