Bluetooth: Audio: Rename VCS to VCP

Renames almost all occurences of VCS to VCP, as we want to
use the profile as the namespace for volume control.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-10-09 12:26:55 +02:00 committed by Carles Cufí
commit ce2b8f9fe1
25 changed files with 2844 additions and 2816 deletions

View file

@ -16,10 +16,10 @@ if (CONFIG_BT_AICS OR CONFIG_BT_AICS_CLIENT)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_AICS_CLIENT aics_client.c)
if (CONFIG_BT_VCS OR CONFIG_BT_VCS_CLIENT)
zephyr_library_sources(vcs.c)
if (CONFIG_BT_VCP OR CONFIG_BT_VCP_CLIENT)
zephyr_library_sources(vcp.c)
endif()
zephyr_library_sources_ifdef(CONFIG_BT_VCS_CLIENT vcs_client.c)
zephyr_library_sources_ifdef(CONFIG_BT_VCP_CLIENT vcp_client.c)
if (CONFIG_BT_MICP_MIC_DEV)
zephyr_library_sources(micp_mic_dev.c)

View file

@ -8,14 +8,14 @@
##################### Volume Control Service #####################
config BT_VCS
bool "Volume Control Service Support [EXPERIMENTAL]"
config BT_VCP
bool "Volume Control Profile Support [EXPERIMENTAL]"
select EXPERIMENTAL
help
This option enables support for Volume Control Service.
if BT_VCS
config BT_VCS_VOCS_INSTANCE_COUNT
if BT_VCP
config BT_VCP_VOCS_INSTANCE_COUNT
int "Volume Offset Control Service instance count"
default 0
range 0 BT_VOCS_MAX_INSTANCE_COUNT
@ -23,14 +23,14 @@ config BT_VCS_VOCS_INSTANCE_COUNT
This option sets the number of instances of Volume Offset Control
Services.
config BT_VCS_VOCS
config BT_VCP_VOCS
bool # Hidden
default y if BT_VCS_VOCS_INSTANCE_COUNT > 0
default y if BT_VCP_VOCS_INSTANCE_COUNT > 0
help
This hidden option makes it possible to easily check if VOCS is
enabled for VCS.
config BT_VCS_AICS_INSTANCE_COUNT
config BT_VCP_AICS_INSTANCE_COUNT
int "Audio Input Control Service instance count for VCS"
default 0
range 0 BT_AICS_MAX_INSTANCE_COUNT
@ -38,42 +38,42 @@ config BT_VCS_AICS_INSTANCE_COUNT
This option sets the number of instances of Audio Input Control
Services for VCS.
config BT_VCS_AICS
config BT_VCP_AICS
bool # Hidden
default y if BT_VCS_AICS_INSTANCE_COUNT > 0
default y if BT_VCP_AICS_INSTANCE_COUNT > 0
help
This hidden option makes it possible to easily check if AICS is
enabled for VCS.
############# DEBUG #############
config BT_DEBUG_VCS
bool "Volume Control Service debug"
config BT_DEBUG_VCP
bool "Volume Control Profile debug"
select DEPRECATED
help
Use this option to enable Volume Control Service debug logs for the
Use this option to enable Volume Control Profile debug logs for the
Bluetooth Audio functionality.
module = BT_VCS
legacy-debug-sym = BT_DEBUG_VCS
module-str = "Volume Control Service"
legacy-debug-sym = BT_DEBUG_VCP
module-str = "Volume Control Profile"
source "subsys/bluetooth/common/Kconfig.template.log_config_bt"
endif # BT_VCS
##################### Volume Control Profile Client #####################
config BT_VCS_CLIENT
bool "Volume Control Profile Support [EXPERIMENTAL]"
config BT_VCP_CLIENT
bool "Volume Control Profile Client Support [EXPERIMENTAL]"
select BT_GATT_CLIENT
select BT_GATT_AUTO_DISCOVER_CCC
select EXPERIMENTAL
help
This option enables support for Volume Control Profile.
if BT_VCS_CLIENT
if BT_VCP_CLIENT
config BT_VCS_CLIENT_MAX_VOCS_INST
config BT_VCP_CLIENT_MAX_VOCS_INST
int "Maximum number of VOCS instances to setup"
default 0
range 0 BT_VOCS_CLIENT_MAX_INSTANCE_COUNT
@ -81,14 +81,14 @@ config BT_VCS_CLIENT_MAX_VOCS_INST
Sets the maximum number of Volume Offset Control Service (VOCS)
instances to setup and use.
config BT_VCS_CLIENT_VOCS
config BT_VCP_CLIENT_VOCS
bool # Hidden
default y if BT_VCS_CLIENT_MAX_VOCS_INST > 0
default y if BT_VCP_CLIENT_MAX_VOCS_INST > 0
help
This hidden option makes it possible to easily check if VOCS is
enabled for VCS client.
config BT_VCS_CLIENT_MAX_AICS_INST
config BT_VCP_CLIENT_MAX_AICS_INST
int "Maximum number of AICS instances to setup"
default 0
range 0 3
@ -96,25 +96,25 @@ config BT_VCS_CLIENT_MAX_AICS_INST
Sets the maximum number of Audio Input Control Service (AICS)
instances to setup and use.
config BT_VCS_CLIENT_AICS
config BT_VCP_CLIENT_AICS
bool # Hidden
default y if BT_VCS_CLIENT_MAX_AICS_INST > 0
default y if BT_VCP_CLIENT_MAX_AICS_INST > 0
help
This hidden option makes it possible to easily check if AICS is
enabled for VCS client.
############# DEBUG #############
config BT_DEBUG_VCS_CLIENT
config BT_DEBUG_VCP_CLIENT
bool "Volume Control Profile debug"
select DEPRECATED
help
Use this option to enable Volume Control Profile debug logs for the
Bluetooth Audio functionality.
module = BT_VCS_CLIENT
legacy-debug-sym = BT_DEBUG_VCS_CLIENT
module-str = "Volume Control Profile"
module = BT_VCP_CLIENT
legacy-debug-sym = BT_DEBUG_VCP_CLIENT
module-str = "Volume Control Profile Client"
source "subsys/bluetooth/common/Kconfig.template.log_config_bt"
endif # BT_VCS_CLIENT
endif # BT_VCP_CLIENT

1046
subsys/bluetooth/audio/vcp.c Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,110 @@
/**
* @file
* @brief Internal Header for Bluetooth Volume Control Service (VCS).
*
* Copyright (c) 2020 Bose Corporation
* Copyright (c) 2020-2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_
#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_
/* VCS opcodes */
#define BT_VCP_OPCODE_REL_VOL_DOWN 0x00
#define BT_VCP_OPCODE_REL_VOL_UP 0x01
#define BT_VCP_OPCODE_UNMUTE_REL_VOL_DOWN 0x02
#define BT_VCP_OPCODE_UNMUTE_REL_VOL_UP 0x03
#define BT_VCP_OPCODE_SET_ABS_VOL 0x04
#define BT_VCP_OPCODE_UNMUTE 0x05
#define BT_VCP_OPCODE_MUTE 0x06
struct vcs_state {
uint8_t volume;
uint8_t mute;
uint8_t change_counter;
} __packed;
struct vcs_control {
uint8_t opcode;
uint8_t counter;
} __packed;
struct vcs_control_vol {
struct vcs_control cp;
uint8_t volume;
} __packed;
#if defined(CONFIG_BT_VCP_CLIENT)
struct bt_vcp_client {
struct vcs_state state;
uint8_t flags;
uint16_t start_handle;
uint16_t end_handle;
uint16_t state_handle;
uint16_t control_handle;
uint16_t flag_handle;
struct bt_gatt_subscribe_params state_sub_params;
struct bt_gatt_discover_params state_sub_disc_params;
struct bt_gatt_subscribe_params flag_sub_params;
struct bt_gatt_discover_params flag_sub_disc_params;
bool cp_retried;
bool busy;
struct vcs_control_vol cp_val;
struct bt_gatt_write_params write_params;
struct bt_gatt_read_params read_params;
struct bt_gatt_discover_params discover_params;
struct bt_uuid_16 uuid;
struct bt_conn *conn;
uint8_t vocs_inst_cnt;
struct bt_vocs *vocs[CONFIG_BT_VCP_CLIENT_MAX_VOCS_INST];
uint8_t aics_inst_cnt;
struct bt_aics *aics[CONFIG_BT_VCP_CLIENT_MAX_AICS_INST];
};
#endif /* CONFIG_BT_VCP_CLIENT */
#if defined(CONFIG_BT_VCP)
struct bt_vcp_server {
struct vcs_state state;
uint8_t flags;
struct bt_vcp_cb *cb;
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];
};
#endif /* CONFIG_BT_VCP */
/* Struct used as a common type for the api */
struct bt_vcp {
bool client_instance;
union {
#if defined(CONFIG_BT_VCP)
struct bt_vcp_server srv;
#endif /* CONFIG_BT_VCP */
#if defined(CONFIG_BT_VCP_CLIENT)
struct bt_vcp_client cli;
#endif /* CONFIG_BT_VCP_CLIENT */
};
};
int bt_vcp_client_included_get(struct bt_vcp *vcp,
struct bt_vcp_included *included);
int bt_vcp_client_read_vol_state(struct bt_vcp *vcp);
int bt_vcp_client_read_flags(struct bt_vcp *vcp);
int bt_vcp_client_vol_down(struct bt_vcp *vcp);
int bt_vcp_client_vol_up(struct bt_vcp *vcp);
int bt_vcp_client_unmute_vol_down(struct bt_vcp *vcp);
int bt_vcp_client_unmute_vol_up(struct bt_vcp *vcp);
int bt_vcp_client_set_volume(struct bt_vcp *vcp, uint8_t volume);
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_*/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,110 +0,0 @@
/**
* @file
* @brief Internal Header for Bluetooth Volume Control Service (VCS).
*
* Copyright (c) 2020 Bose Corporation
* Copyright (c) 2020-2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_
#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_
/* VCS opcodes */
#define BT_VCS_OPCODE_REL_VOL_DOWN 0x00
#define BT_VCS_OPCODE_REL_VOL_UP 0x01
#define BT_VCS_OPCODE_UNMUTE_REL_VOL_DOWN 0x02
#define BT_VCS_OPCODE_UNMUTE_REL_VOL_UP 0x03
#define BT_VCS_OPCODE_SET_ABS_VOL 0x04
#define BT_VCS_OPCODE_UNMUTE 0x05
#define BT_VCS_OPCODE_MUTE 0x06
struct vcs_state {
uint8_t volume;
uint8_t mute;
uint8_t change_counter;
} __packed;
struct vcs_control {
uint8_t opcode;
uint8_t counter;
} __packed;
struct vcs_control_vol {
struct vcs_control cp;
uint8_t volume;
} __packed;
#if defined(CONFIG_BT_VCS_CLIENT)
struct bt_vcs_client {
struct vcs_state state;
uint8_t flags;
uint16_t start_handle;
uint16_t end_handle;
uint16_t state_handle;
uint16_t control_handle;
uint16_t flag_handle;
struct bt_gatt_subscribe_params state_sub_params;
struct bt_gatt_discover_params state_sub_disc_params;
struct bt_gatt_subscribe_params flag_sub_params;
struct bt_gatt_discover_params flag_sub_disc_params;
bool cp_retried;
bool busy;
struct vcs_control_vol cp_val;
struct bt_gatt_write_params write_params;
struct bt_gatt_read_params read_params;
struct bt_gatt_discover_params discover_params;
struct bt_uuid_16 uuid;
struct bt_conn *conn;
uint8_t vocs_inst_cnt;
struct bt_vocs *vocs[CONFIG_BT_VCS_CLIENT_MAX_VOCS_INST];
uint8_t aics_inst_cnt;
struct bt_aics *aics[CONFIG_BT_VCS_CLIENT_MAX_AICS_INST];
};
#endif /* CONFIG_BT_VCS_CLIENT */
#if defined(CONFIG_BT_VCS)
struct bt_vcs_server {
struct vcs_state state;
uint8_t flags;
struct bt_vcs_cb *cb;
uint8_t volume_step;
struct bt_gatt_service *service_p;
struct bt_vocs *vocs_insts[CONFIG_BT_VCS_VOCS_INSTANCE_COUNT];
struct bt_aics *aics_insts[CONFIG_BT_VCS_AICS_INSTANCE_COUNT];
};
#endif /* CONFIG_BT_VCS */
/* Struct used as a common type for the api */
struct bt_vcs {
bool client_instance;
union {
#if defined(CONFIG_BT_VCS)
struct bt_vcs_server srv;
#endif /* CONFIG_BT_VCS */
#if defined(CONFIG_BT_VCS_CLIENT)
struct bt_vcs_client cli;
#endif /* CONFIG_BT_VCS_CLIENT */
};
};
int bt_vcs_client_included_get(struct bt_vcs *vcs,
struct bt_vcs_included *included);
int bt_vcs_client_read_vol_state(struct bt_vcs *vcs);
int bt_vcs_client_read_flags(struct bt_vcs *vcs);
int bt_vcs_client_vol_down(struct bt_vcs *vcs);
int bt_vcs_client_vol_up(struct bt_vcs *vcs);
int bt_vcs_client_unmute_vol_down(struct bt_vcs *vcs);
int bt_vcs_client_unmute_vol_up(struct bt_vcs *vcs);
int bt_vcs_client_set_volume(struct bt_vcs *vcs, uint8_t volume);
int bt_vcs_client_unmute(struct bt_vcs *vcs);
int bt_vcs_client_mute(struct bt_vcs *vcs);
bool bt_vcs_client_valid_vocs_inst(struct bt_vcs *vcs, struct bt_vocs *vocs);
bool bt_vcs_client_valid_aics_inst(struct bt_vcs *vcs, struct bt_aics *aics);
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_VCP_INTERNAL_*/

View file

@ -1,7 +1,7 @@
/* Bluetooth VOCS - Volume Offset Control Service - Client */
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
* Copyright (c) 2021-2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -244,8 +244,8 @@ static uint8_t internal_read_volume_offset_state_cb(struct bt_conn *conn, uint8_
return BT_GATT_ITER_STOP;
}
static void vcs_client_write_vocs_cp_cb(struct bt_conn *conn, uint8_t err,
struct bt_gatt_write_params *params)
static void vocs_client_write_vocs_cp_cb(struct bt_conn *conn, uint8_t err,
struct bt_gatt_write_params *params)
{
int cb_err = err;
struct bt_vocs *inst = lookup_vocs_by_handle(conn, params->handle);
@ -291,9 +291,9 @@ static void vcs_client_write_vocs_cp_cb(struct bt_conn *conn, uint8_t err,
}
}
static uint8_t vcs_client_read_output_desc_cb(struct bt_conn *conn, uint8_t err,
struct bt_gatt_read_params *params,
const void *data, uint16_t length)
static uint8_t vocs_client_read_output_desc_cb(struct bt_conn *conn, uint8_t err,
struct bt_gatt_read_params *params,
const void *data, uint16_t length)
{
int cb_err = err;
struct bt_vocs *inst = lookup_vocs_by_handle(conn, params->single.handle);
@ -554,7 +554,7 @@ int bt_vocs_client_state_set(struct bt_vocs *inst, int16_t offset)
inst->cli.write_params.data = &inst->cli.cp;
inst->cli.write_params.length = sizeof(inst->cli.cp);
inst->cli.write_params.handle = inst->cli.control_handle;
inst->cli.write_params.func = vcs_client_write_vocs_cp_cb;
inst->cli.write_params.func = vocs_client_write_vocs_cp_cb;
err = bt_gatt_write(inst->cli.conn, &inst->cli.write_params);
if (!err) {
@ -585,7 +585,7 @@ int bt_vocs_client_description_get(struct bt_vocs *inst)
return -EBUSY;
}
inst->cli.read_params.func = vcs_client_read_output_desc_cb;
inst->cli.read_params.func = vocs_client_read_output_desc_cb;
inst->cli.read_params.handle_count = 1;
inst->cli.read_params.single.handle = inst->cli.desc_handle;
inst->cli.read_params.single.offset = 0U;

View file

@ -26,12 +26,12 @@ zephyr_library_sources_ifdef(
iso.c
)
zephyr_library_sources_ifdef(
CONFIG_BT_VCS
vcs.c
CONFIG_BT_VCP
vcp.c
)
zephyr_library_sources_ifdef(
CONFIG_BT_VCS_CLIENT
vcs_client.c
CONFIG_BT_VCP_CLIENT
vcp_client.c
)
zephyr_library_sources_ifdef(
CONFIG_BT_MICP_MIC_DEV

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_VCS, (BT_UUID_16_ENCODE(BT_UUID_VCS_VAL),))
IF_ENABLED(CONFIG_BT_VCP, (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

@ -1,5 +1,5 @@
/** @file
* @brief Bluetooth VCS server shell.
* @brief Bluetooth VCP server shell.
*
* Copyright (c) 2020 Bose Corporation
* Copyright (c) 2020-2022 Nordic Semiconductor ASA
@ -17,25 +17,25 @@
#include "bt.h"
static struct bt_vcs *vcs;
static struct bt_vcs_included vcs_included;
static struct bt_vcp *vcp;
static struct bt_vcp_included vcp_included;
static void vcs_state_cb(struct bt_vcs *vcs, int err, uint8_t volume,
static void vcs_state_cb(struct bt_vcp *vcp, int err, uint8_t volume,
uint8_t mute)
{
if (err) {
shell_error(ctx_shell, "VCS state get failed (%d)", err);
shell_error(ctx_shell, "VCP state get failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS volume %u, mute %u", volume, mute);
shell_print(ctx_shell, "VCP volume %u, mute %u", volume, mute);
}
}
static void vcs_flags_cb(struct bt_vcs *vcs, int err, uint8_t flags)
static void vcs_flags_cb(struct bt_vcp *vcp, int err, uint8_t flags)
{
if (err) {
shell_error(ctx_shell, "VCS flags get failed (%d)", err);
shell_error(ctx_shell, "VCP flags get failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS flags 0x%02X", flags);
shell_print(ctx_shell, "VCP flags 0x%02X", flags);
}
}
@ -139,7 +139,7 @@ static void vocs_description_cb(struct bt_vocs *inst, int err,
}
}
static struct bt_vcs_cb vcs_cbs = {
static struct bt_vcp_cb vcs_cbs = {
.state = vcs_state_cb,
.flags = vcs_flags_cb,
};
@ -161,9 +161,9 @@ static struct bt_vocs_cb vocs_cbs = {
static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
{
int result = 0;
struct bt_vcs_register_param vcs_param;
char input_desc[CONFIG_BT_VCS_AICS_INSTANCE_COUNT][16];
char output_desc[CONFIG_BT_VCS_VOCS_INSTANCE_COUNT][16];
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];
static const char assignment_operator[] = "=";
if (!ctx_shell) {
@ -197,7 +197,7 @@ static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
/* Default values */
vcs_param.step = 1;
vcs_param.mute = BT_VCS_STATE_UNMUTED;
vcs_param.mute = BT_VCP_STATE_UNMUTED;
vcs_param.volume = 100;
for (int i = 1; i < argc; i++) {
@ -228,13 +228,13 @@ static int cmd_vcs_init(const struct shell *sh, size_t argc, char **argv)
vcs_param.cb = &vcs_cbs;
result = bt_vcs_register(&vcs_param, &vcs);
result = bt_vcp_register(&vcs_param, &vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
return result;
}
result = bt_vcs_included_get(vcs, &vcs_included);
result = bt_vcp_included_get(vcp, &vcp_included);
if (result != 0) {
shell_error(sh, "Failed to get included services: %d", result);
return result;
@ -255,7 +255,7 @@ static int cmd_vcs_volume_step(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_step_set(step);
result = bt_vcp_vol_step_set(step);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -266,7 +266,7 @@ static int cmd_vcs_volume_step(const struct shell *sh, size_t argc,
static int cmd_vcs_state_get(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_vol_get(vcs);
int result = bt_vcp_vol_get(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -278,7 +278,7 @@ static int cmd_vcs_state_get(const struct shell *sh, size_t argc,
static int cmd_vcs_flags_get(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_flags_get(vcs);
int result = bt_vcp_flags_get(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -290,7 +290,7 @@ static int cmd_vcs_flags_get(const struct shell *sh, size_t argc,
static int cmd_vcs_volume_down(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_vol_down(vcs);
int result = bt_vcp_vol_down(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -303,7 +303,7 @@ static int cmd_vcs_volume_up(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_vol_up(vcs);
int result = bt_vcp_vol_up(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -315,7 +315,7 @@ static int cmd_vcs_volume_up(const struct shell *sh, size_t argc,
static int cmd_vcs_unmute_volume_down(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_unmute_vol_down(vcs);
int result = bt_vcp_unmute_vol_down(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -327,7 +327,7 @@ static int cmd_vcs_unmute_volume_down(const struct shell *sh, size_t argc,
static int cmd_vcs_unmute_volume_up(const struct shell *sh, size_t argc,
char **argv)
{
int result = bt_vcs_unmute_vol_up(vcs);
int result = bt_vcp_unmute_vol_up(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -348,7 +348,7 @@ static int cmd_vcs_volume_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_set(vcs, volume);
result = bt_vcp_vol_set(vcp, volume);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -358,7 +358,7 @@ static int cmd_vcs_volume_set(const struct shell *sh, size_t argc,
static int cmd_vcs_unmute(const struct shell *sh, size_t argc, char **argv)
{
int result = bt_vcs_unmute(vcs);
int result = bt_vcp_unmute(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -369,7 +369,7 @@ static int cmd_vcs_unmute(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcs_mute(const struct shell *sh, size_t argc, char **argv)
{
int result = bt_vcs_mute(vcs);
int result = bt_vcp_mute(vcp);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -386,13 +386,13 @@ 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_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_state_get(NULL, vcs_included.vocs[index]);
result = bt_vcp_vocs_state_get(NULL, vcp_included.vocs[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -406,13 +406,13 @@ static int cmd_vcs_vocs_location_get(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index > CONFIG_BT_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_location_get(NULL, vcs_included.vocs[index]);
result = bt_vcp_vocs_location_get(NULL, vcp_included.vocs[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -427,9 +427,9 @@ static int cmd_vcs_vocs_location_set(const struct shell *sh, size_t argc,
int index = strtol(argv[1], NULL, 0);
int location = strtol(argv[2], NULL, 0);
if (index > CONFIG_BT_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
if (location > UINT16_MAX || location < 0) {
@ -439,7 +439,7 @@ static int cmd_vcs_vocs_location_set(const struct shell *sh, size_t argc,
}
result = bt_vcs_vocs_location_set(NULL, vcs_included.vocs[index],
result = bt_vcp_vocs_location_set(NULL, vcp_included.vocs[index],
location);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -455,9 +455,9 @@ static int cmd_vcs_vocs_offset_set(const struct shell *sh, size_t argc,
int index = strtol(argv[1], NULL, 0);
int offset = strtol(argv[2], NULL, 0);
if (index > CONFIG_BT_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
@ -467,7 +467,7 @@ static int cmd_vcs_vocs_offset_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vocs_state_set(NULL, vcs_included.vocs[index], offset);
result = bt_vcp_vocs_state_set(NULL, vcp_included.vocs[index], offset);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -481,13 +481,13 @@ static int cmd_vcs_vocs_output_description_get(const struct shell *sh,
int result;
int index = strtol(argv[1], NULL, 0);
if (index > CONFIG_BT_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_description_get(NULL, vcs_included.vocs[index]);
result = bt_vcp_vocs_description_get(NULL, vcp_included.vocs[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -502,13 +502,13 @@ static int cmd_vcs_vocs_output_description_set(const struct shell *sh,
int index = strtol(argv[1], NULL, 0);
char *description = argv[2];
if (index > CONFIG_BT_VCS_VOCS_INSTANCE_COUNT) {
if (index > CONFIG_BT_VCP_VOCS_INSTANCE_COUNT) {
shell_error(sh, "Index out of range; 0-%u, was %u",
CONFIG_BT_VCS_VOCS_INSTANCE_COUNT, index);
CONFIG_BT_VCP_VOCS_INSTANCE_COUNT, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_description_set(NULL, vcs_included.vocs[index],
result = bt_vcp_vocs_description_set(NULL, vcp_included.vocs[index],
description);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -523,13 +523,13 @@ static int cmd_vcs_aics_input_state_get(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_state_get(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_state_get(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -543,13 +543,13 @@ static int cmd_vcs_aics_gain_setting_get(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_gain_setting_get(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_gain_setting_get(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -563,13 +563,13 @@ static int cmd_vcs_aics_input_type_get(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_type_get(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_type_get(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -583,13 +583,13 @@ static int cmd_vcs_aics_input_status_get(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_status_get(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_status_get(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -603,13 +603,13 @@ static int cmd_vcs_aics_input_unmute(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_unmute(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_unmute(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -623,13 +623,13 @@ static int cmd_vcs_aics_input_mute(const struct shell *sh, size_t argc,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_mute(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_mute(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -643,13 +643,13 @@ static int cmd_vcs_aics_manual_input_gain_set(const struct shell *sh,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_manual_gain_set(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_manual_gain_set(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -663,13 +663,13 @@ static int cmd_vcs_aics_automatic_input_gain_set(const struct shell *sh,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_automatic_gain_set(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_automatic_gain_set(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -684,9 +684,9 @@ static int cmd_vcs_aics_gain_set(const struct shell *sh, size_t argc,
int index = strtol(argv[1], NULL, 0);
int gain = strtol(argv[2], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
@ -696,7 +696,7 @@ static int cmd_vcs_aics_gain_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_aics_gain_set(NULL, vcs_included.aics[index], gain);
result = bt_vcp_aics_gain_set(NULL, vcp_included.aics[index], gain);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -710,13 +710,13 @@ static int cmd_vcs_aics_input_description_get(const struct shell *sh,
int result;
int index = strtol(argv[1], NULL, 0);
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_description_get(NULL, vcs_included.aics[index]);
result = bt_vcp_aics_description_get(NULL, vcp_included.aics[index]);
if (result) {
shell_print(sh, "Fail: %d", result);
}
@ -731,13 +731,13 @@ static int cmd_vcs_aics_input_description_set(const struct shell *sh,
int index = strtol(argv[1], NULL, 0);
char *description = argv[2];
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_description_set(NULL, vcs_included.aics[index],
result = bt_vcp_aics_description_set(NULL, vcp_included.aics[index],
description);
if (result) {
shell_print(sh, "Fail: %d", result);
@ -764,7 +764,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(vcs_cmds,
"[step=<uint>] [mute=<bool>] [volume=<uint>]",
cmd_vcs_init, 1, 3),
SHELL_CMD_ARG(state_get, NULL,
"Get volume state of the VCS server. Should be done "
"Get volume state of the VCP server. Should be done "
"before sending any control messages",
cmd_vcs_state_get, 1, 0),
SHELL_CMD_ARG(flags_get, NULL,
@ -857,5 +857,5 @@ SHELL_STATIC_SUBCMD_SET_CREATE(vcs_cmds,
SHELL_SUBCMD_SET_END
);
SHELL_CMD_ARG_REGISTER(vcs, &vcs_cmds, "Bluetooth VCS shell commands",
SHELL_CMD_ARG_REGISTER(vcp, &vcs_cmds, "Bluetooth VCP shell commands",
cmd_vcs, 1, 1);

View file

@ -1,5 +1,5 @@
/** @file
* @brief Bluetooth VCS client shell.
* @brief Bluetooth VCP client shell.
*
* Copyright (c) 2020 Bose Corporation
* Copyright (c) 2020-2022 Nordic Semiconductor ASA
@ -15,107 +15,107 @@
#include "bt.h"
static struct bt_vcs *vcs;
static struct bt_vcs_included vcs_included;
static struct bt_vcp *vcp;
static struct bt_vcp_included vcp_included;
static void vcs_discover_cb(struct bt_vcs *vcs, int err, uint8_t vocs_count,
static void vcs_discover_cb(struct bt_vcp *vcp, int err, uint8_t vocs_count,
uint8_t aics_count)
{
if (err != 0) {
shell_error(ctx_shell, "VCS discover failed (%d)", err);
shell_error(ctx_shell, "VCP discover failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS discover done with %u AICS",
shell_print(ctx_shell, "VCP discover done with %u AICS",
aics_count);
if (bt_vcs_included_get(vcs, &vcs_included)) {
shell_error(ctx_shell, "Could not get VCS context");
if (bt_vcp_included_get(vcp, &vcp_included)) {
shell_error(ctx_shell, "Could not get VCP context");
}
}
}
static void vcs_vol_down_cb(struct bt_vcs *vcs, int err)
static void vcs_vol_down_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS vol_down failed (%d)", err);
shell_error(ctx_shell, "VCP vol_down failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS vol_down done");
shell_print(ctx_shell, "VCP vol_down done");
}
}
static void vcs_vol_up_cb(struct bt_vcs *vcs, int err)
static void vcs_vol_up_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS vol_up failed (%d)", err);
shell_error(ctx_shell, "VCP vol_up failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS vol_up done");
shell_print(ctx_shell, "VCP vol_up done");
}
}
static void vcs_mute_cb(struct bt_vcs *vcs, int err)
static void vcs_mute_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS mute failed (%d)", err);
shell_error(ctx_shell, "VCP mute failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS mute done");
shell_print(ctx_shell, "VCP mute done");
}
}
static void vcs_unmute_cb(struct bt_vcs *vcs, int err)
static void vcs_unmute_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS unmute failed (%d)", err);
shell_error(ctx_shell, "VCP unmute failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS unmute done");
shell_print(ctx_shell, "VCP unmute done");
}
}
static void vcs_vol_down_unmute_cb(struct bt_vcs *vcs, int err)
static void vcs_vol_down_unmute_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS vol_down_unmute failed (%d)", err);
shell_error(ctx_shell, "VCP vol_down_unmute failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS vol_down_unmute done");
shell_print(ctx_shell, "VCP vol_down_unmute done");
}
}
static void vcs_vol_up_unmute_cb(struct bt_vcs *vcs, int err)
static void vcs_vol_up_unmute_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS vol_up_unmute failed (%d)", err);
shell_error(ctx_shell, "VCP vol_up_unmute failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS vol_up_unmute done");
shell_print(ctx_shell, "VCP vol_up_unmute done");
}
}
static void vcs_vol_set_cb(struct bt_vcs *vcs, int err)
static void vcs_vol_set_cb(struct bt_vcp *vcp, int err)
{
if (err != 0) {
shell_error(ctx_shell, "VCS vol_set failed (%d)", err);
shell_error(ctx_shell, "VCP vol_set failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS vol_set done");
shell_print(ctx_shell, "VCP vol_set done");
}
}
static void vcs_state_cb(struct bt_vcs *vcs, int err, uint8_t volume,
static void vcs_state_cb(struct bt_vcp *vcp, int err, uint8_t volume,
uint8_t mute)
{
if (err != 0) {
shell_error(ctx_shell, "VCS state get failed (%d)", err);
shell_error(ctx_shell, "VCP state get failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS volume %u, mute %u", volume, mute);
shell_print(ctx_shell, "VCP volume %u, mute %u", volume, mute);
}
}
static void vcs_flags_cb(struct bt_vcs *vcs, int err, uint8_t flags)
static void vcs_flags_cb(struct bt_vcp *vcp, int err, uint8_t flags)
{
if (err != 0) {
shell_error(ctx_shell, "VCS flags get failed (%d)", err);
shell_error(ctx_shell, "VCP flags get failed (%d)", err);
} else {
shell_print(ctx_shell, "VCS flags 0x%02X", flags);
shell_print(ctx_shell, "VCP flags 0x%02X", flags);
}
}
#if CONFIG_BT_VCS_CLIENT_MAX_AICS_INST > 0
#if CONFIG_BT_VCP_CLIENT_MAX_AICS_INST > 0
static void vcs_aics_set_gain_cb(struct bt_aics *inst, int err)
{
if (err != 0) {
@ -234,9 +234,9 @@ static void vcs_aics_description_cb(struct bt_aics *inst, int err,
inst, description);
}
}
#endif /* CONFIG_BT_VCS_CLIENT_MAX_AICS_INST > 0 */
#endif /* CONFIG_BT_VCP_CLIENT_MAX_AICS_INST > 0 */
#if CONFIG_BT_VCS_CLIENT_MAX_VOCS_INST > 0
#if CONFIG_BT_VCP_CLIENT_MAX_VOCS_INST > 0
static void vcs_vocs_set_offset_cb(struct bt_vocs *inst, int err)
{
if (err != 0) {
@ -282,9 +282,9 @@ static void vcs_vocs_description_cb(struct bt_vocs *inst, int err,
inst, description);
}
}
#endif /* CONFIG_BT_VCS_CLIENT_MAX_VOCS_INST > 0 */
#endif /* CONFIG_BT_VCP_CLIENT_MAX_VOCS_INST > 0 */
static struct bt_vcs_cb vcs_cbs = {
static struct bt_vcp_cb vcs_cbs = {
.discover = vcs_discover_cb,
.vol_down = vcs_vol_down_cb,
.vol_up = vcs_vol_up_cb,
@ -298,7 +298,7 @@ static struct bt_vcs_cb vcs_cbs = {
.flags = vcs_flags_cb,
/* Audio Input Control Service */
#if CONFIG_BT_VCS_CLIENT_MAX_AICS_INST > 0
#if CONFIG_BT_VCP_CLIENT_MAX_AICS_INST > 0
.aics_cb = {
.state = vcs_aics_state_cb,
.gain_setting = vcs_aics_gain_setting_cb,
@ -311,18 +311,18 @@ static struct bt_vcs_cb vcs_cbs = {
.set_manual_mode = vcs_aics_set_manual_mode_cb,
.set_auto_mode = vcs_aics_automatic_mode_cb,
},
#endif /* CONFIG_BT_VCS_CLIENT_MAX_AICS_INST > 0 */
#if CONFIG_BT_VCS_CLIENT_MAX_VOCS_INST > 0
#endif /* CONFIG_BT_VCP_CLIENT_MAX_AICS_INST > 0 */
#if CONFIG_BT_VCP_CLIENT_MAX_VOCS_INST > 0
.vocs_cb = {
.state = vcs_vocs_state_cb,
.location = vcs_vocs_location_cb,
.description = vcs_vocs_description_cb,
.set_offset = vcs_vocs_set_offset_cb,
}
#endif /* CONFIG_BT_VCS_CLIENT_MAX_VOCS_INST > 0 */
#endif /* CONFIG_BT_VCP_CLIENT_MAX_VOCS_INST > 0 */
};
static int cmd_vcs_client_discover(const struct shell *sh, size_t argc,
static int cmd_vcp_client_discover(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -331,7 +331,7 @@ static int cmd_vcs_client_discover(const struct shell *sh, size_t argc,
ctx_shell = sh;
}
result = bt_vcs_client_cb_register(&vcs_cbs);
result = bt_vcp_client_cb_register(&vcs_cbs);
if (result != 0) {
shell_print(sh, "CB register failed: %d", result);
return result;
@ -342,7 +342,7 @@ static int cmd_vcs_client_discover(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_discover(default_conn, &vcs);
result = bt_vcp_discover(default_conn, &vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -350,7 +350,7 @@ static int cmd_vcs_client_discover(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_state_get(const struct shell *sh, size_t argc,
static int cmd_vcp_client_state_get(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -360,7 +360,7 @@ static int cmd_vcs_client_state_get(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_get(vcs);
result = bt_vcp_vol_get(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -368,7 +368,7 @@ static int cmd_vcs_client_state_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_flags_get(const struct shell *sh, size_t argc,
static int cmd_vcp_client_flags_get(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -378,7 +378,7 @@ static int cmd_vcs_client_flags_get(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_flags_get(vcs);
result = bt_vcp_flags_get(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -386,7 +386,7 @@ static int cmd_vcs_client_flags_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_volume_down(const struct shell *sh, size_t argc,
static int cmd_vcp_client_volume_down(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -396,7 +396,7 @@ static int cmd_vcs_client_volume_down(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_down(vcs);
result = bt_vcp_vol_down(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -404,7 +404,7 @@ static int cmd_vcs_client_volume_down(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_volume_up(const struct shell *sh, size_t argc,
static int cmd_vcp_client_volume_up(const struct shell *sh, size_t argc,
char **argv)
{
@ -415,7 +415,7 @@ static int cmd_vcs_client_volume_up(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_up(vcs);
result = bt_vcp_vol_up(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -423,7 +423,7 @@ static int cmd_vcs_client_volume_up(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_unmute_volume_down(const struct shell *sh,
static int cmd_vcp_client_unmute_volume_down(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -433,7 +433,7 @@ static int cmd_vcs_client_unmute_volume_down(const struct shell *sh,
return -ENOEXEC;
}
result = bt_vcs_unmute_vol_down(vcs);
result = bt_vcp_unmute_vol_down(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -441,7 +441,7 @@ static int cmd_vcs_client_unmute_volume_down(const struct shell *sh,
return result;
}
static int cmd_vcs_client_unmute_volume_up(const struct shell *sh,
static int cmd_vcp_client_unmute_volume_up(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -451,7 +451,7 @@ static int cmd_vcs_client_unmute_volume_up(const struct shell *sh,
return -ENOEXEC;
}
result = bt_vcs_unmute_vol_up(vcs);
result = bt_vcp_unmute_vol_up(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -459,7 +459,7 @@ static int cmd_vcs_client_unmute_volume_up(const struct shell *sh,
return result;
}
static int cmd_vcs_client_volume_set(const struct shell *sh, size_t argc,
static int cmd_vcp_client_volume_set(const struct shell *sh, size_t argc,
char **argv)
{
@ -476,7 +476,7 @@ static int cmd_vcs_client_volume_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_vol_set(vcs, volume);
result = bt_vcp_vol_set(vcp, volume);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -485,7 +485,7 @@ static int cmd_vcs_client_volume_set(const struct shell *sh, size_t argc,
}
static int cmd_vcs_client_unmute(const struct shell *sh, size_t argc,
static int cmd_vcp_client_unmute(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -495,7 +495,7 @@ static int cmd_vcs_client_unmute(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_unmute(vcs);
result = bt_vcp_unmute(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -503,7 +503,7 @@ static int cmd_vcs_client_unmute(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_mute(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_client_mute(const struct shell *sh, size_t argc, char **argv)
{
int result;
@ -512,7 +512,7 @@ static int cmd_vcs_client_mute(const struct shell *sh, size_t argc, char **argv)
return -ENOEXEC;
}
result = bt_vcs_mute(vcs);
result = bt_vcp_mute(vcp);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -520,7 +520,7 @@ static int cmd_vcs_client_mute(const struct shell *sh, size_t argc, char **argv)
return result;
}
static int cmd_vcs_client_vocs_state_get(const struct shell *sh, size_t argc,
static int cmd_vcp_client_vocs_state_get(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -531,13 +531,13 @@ static int cmd_vcs_client_vocs_state_get(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_state_get(vcs, vcs_included.vocs[index]);
result = bt_vcp_vocs_state_get(vcp, vcp_included.vocs[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -545,7 +545,7 @@ static int cmd_vcs_client_vocs_state_get(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_vocs_location_get(const struct shell *sh,
static int cmd_vcp_client_vocs_location_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -556,13 +556,13 @@ static int cmd_vcs_client_vocs_location_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_location_get(vcs, vcs_included.vocs[index]);
result = bt_vcp_vocs_location_get(vcp, vcp_included.vocs[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -570,7 +570,7 @@ static int cmd_vcs_client_vocs_location_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_vocs_location_set(const struct shell *sh,
static int cmd_vcp_client_vocs_location_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -582,9 +582,9 @@ static int cmd_vcs_client_vocs_location_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
@ -595,7 +595,7 @@ static int cmd_vcs_client_vocs_location_set(const struct shell *sh,
}
result = bt_vcs_vocs_location_set(vcs, vcs_included.vocs[index],
result = bt_vcp_vocs_location_set(vcp, vcp_included.vocs[index],
location);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
@ -604,7 +604,7 @@ static int cmd_vcs_client_vocs_location_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client_vocs_offset_set(const struct shell *sh,
static int cmd_vcp_client_vocs_offset_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -616,9 +616,9 @@ static int cmd_vcs_client_vocs_offset_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
@ -628,7 +628,7 @@ static int cmd_vcs_client_vocs_offset_set(const struct shell *sh,
return -ENOEXEC;
}
result = bt_vcs_vocs_state_set(vcs, vcs_included.vocs[index],
result = bt_vcp_vocs_state_set(vcp, vcp_included.vocs[index],
offset);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
@ -637,7 +637,7 @@ static int cmd_vcs_client_vocs_offset_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client_vocs_output_description_get(const struct shell *sh,
static int cmd_vcp_client_vocs_output_description_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -648,13 +648,13 @@ static int cmd_vcs_client_vocs_output_description_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_description_get(vcs, vcs_included.vocs[index]);
result = bt_vcp_vocs_description_get(vcp, vcp_included.vocs[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -662,7 +662,7 @@ static int cmd_vcs_client_vocs_output_description_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_vocs_output_description_set(const struct shell *sh,
static int cmd_vcp_client_vocs_output_description_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -674,13 +674,13 @@ static int cmd_vcs_client_vocs_output_description_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.vocs_cnt) {
if (index >= vcp_included.vocs_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.vocs_cnt, index);
vcp_included.vocs_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_vocs_description_set(vcs, vcs_included.vocs[index],
result = bt_vcp_vocs_description_set(vcp, vcp_included.vocs[index],
description);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
@ -689,7 +689,7 @@ static int cmd_vcs_client_vocs_output_description_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_state_get(const struct shell *sh,
static int cmd_vcp_client_aics_input_state_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -700,13 +700,13 @@ static int cmd_vcs_client_aics_input_state_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_state_get(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_state_get(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -714,7 +714,7 @@ static int cmd_vcs_client_aics_input_state_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_gain_setting_get(const struct shell *sh,
static int cmd_vcp_client_aics_gain_setting_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -725,13 +725,13 @@ static int cmd_vcs_client_aics_gain_setting_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_gain_setting_get(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_gain_setting_get(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -739,7 +739,7 @@ static int cmd_vcs_client_aics_gain_setting_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_type_get(const struct shell *sh,
static int cmd_vcp_client_aics_input_type_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -750,13 +750,13 @@ static int cmd_vcs_client_aics_input_type_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_type_get(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_type_get(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -764,7 +764,7 @@ static int cmd_vcs_client_aics_input_type_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_status_get(const struct shell *sh,
static int cmd_vcp_client_aics_input_status_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -775,13 +775,13 @@ static int cmd_vcs_client_aics_input_status_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_status_get(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_status_get(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -789,7 +789,7 @@ static int cmd_vcs_client_aics_input_status_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_unmute(const struct shell *sh,
static int cmd_vcp_client_aics_input_unmute(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -800,13 +800,13 @@ static int cmd_vcs_client_aics_input_unmute(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_unmute(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_unmute(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -814,7 +814,7 @@ static int cmd_vcs_client_aics_input_unmute(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_mute(const struct shell *sh,
static int cmd_vcp_client_aics_input_mute(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -825,13 +825,13 @@ static int cmd_vcs_client_aics_input_mute(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_mute(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_mute(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -839,7 +839,7 @@ static int cmd_vcs_client_aics_input_mute(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_manual_input_gain_set(const struct shell *sh,
static int cmd_vcp_client_aics_manual_input_gain_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -850,13 +850,13 @@ static int cmd_vcs_client_aics_manual_input_gain_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_manual_gain_set(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_manual_gain_set(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -864,7 +864,7 @@ static int cmd_vcs_client_aics_manual_input_gain_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_auto_input_gain_set(const struct shell *sh,
static int cmd_vcp_client_aics_auto_input_gain_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -875,13 +875,13 @@ static int cmd_vcs_client_aics_auto_input_gain_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_automatic_gain_set(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_automatic_gain_set(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -889,7 +889,7 @@ static int cmd_vcs_client_aics_auto_input_gain_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_gain_set(const struct shell *sh, size_t argc,
static int cmd_vcp_client_aics_gain_set(const struct shell *sh, size_t argc,
char **argv)
{
int result;
@ -901,9 +901,9 @@ static int cmd_vcs_client_aics_gain_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
@ -913,7 +913,7 @@ static int cmd_vcs_client_aics_gain_set(const struct shell *sh, size_t argc,
return -ENOEXEC;
}
result = bt_vcs_aics_gain_set(vcs, vcs_included.aics[index], gain);
result = bt_vcp_aics_gain_set(vcp, vcp_included.aics[index], gain);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -921,7 +921,7 @@ static int cmd_vcs_client_aics_gain_set(const struct shell *sh, size_t argc,
return result;
}
static int cmd_vcs_client_aics_input_description_get(const struct shell *sh,
static int cmd_vcp_client_aics_input_description_get(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -932,13 +932,13 @@ static int cmd_vcs_client_aics_input_description_get(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_description_get(vcs, vcs_included.aics[index]);
result = bt_vcp_aics_description_get(vcp, vcp_included.aics[index]);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
}
@ -946,7 +946,7 @@ static int cmd_vcs_client_aics_input_description_get(const struct shell *sh,
return result;
}
static int cmd_vcs_client_aics_input_description_set(const struct shell *sh,
static int cmd_vcp_client_aics_input_description_set(const struct shell *sh,
size_t argc, char **argv)
{
int result;
@ -958,13 +958,13 @@ static int cmd_vcs_client_aics_input_description_set(const struct shell *sh,
return -ENOEXEC;
}
if (index >= vcs_included.aics_cnt) {
if (index >= vcp_included.aics_cnt) {
shell_error(sh, "Index shall be less than %u, was %u",
vcs_included.aics_cnt, index);
vcp_included.aics_cnt, index);
return -ENOEXEC;
}
result = bt_vcs_aics_description_set(vcs, vcs_included.aics[index],
result = bt_vcp_aics_description_set(vcp, vcp_included.aics[index],
description);
if (result != 0) {
shell_print(sh, "Fail: %d", result);
@ -973,7 +973,7 @@ static int cmd_vcs_client_aics_input_description_set(const struct shell *sh,
return result;
}
static int cmd_vcs_client(const struct shell *sh, size_t argc, char **argv)
static int cmd_vcp_client(const struct shell *sh, size_t argc, char **argv)
{
if (argc > 1) {
shell_error(sh, "%s unknown parameter: %s",
@ -985,101 +985,101 @@ static int cmd_vcs_client(const struct shell *sh, size_t argc, char **argv)
return -ENOEXEC;
}
SHELL_STATIC_SUBCMD_SET_CREATE(vcs_client_cmds,
SHELL_STATIC_SUBCMD_SET_CREATE(vcp_client_cmds,
SHELL_CMD_ARG(discover, NULL,
"Discover VCS and included services for current "
"Discover VCP and included services for current "
"connection",
cmd_vcs_client_discover, 1, 0),
cmd_vcp_client_discover, 1, 0),
SHELL_CMD_ARG(state_get, NULL,
"Get volume state of the VCS server. Should be done "
"Get volume state of the VCP server. Should be done "
"before sending any control messages",
cmd_vcs_client_state_get, 1, 0),
cmd_vcp_client_state_get, 1, 0),
SHELL_CMD_ARG(flags_get, NULL,
"Read volume flags",
cmd_vcs_client_flags_get, 1, 0),
cmd_vcp_client_flags_get, 1, 0),
SHELL_CMD_ARG(volume_down, NULL,
"Turn the volume down",
cmd_vcs_client_volume_down, 1, 0),
cmd_vcp_client_volume_down, 1, 0),
SHELL_CMD_ARG(volume_up, NULL,
"Turn the volume up",
cmd_vcs_client_volume_up, 1, 0),
cmd_vcp_client_volume_up, 1, 0),
SHELL_CMD_ARG(unmute_volume_down, NULL,
"Turn the volume down, and unmute",
cmd_vcs_client_unmute_volume_down, 1, 0),
cmd_vcp_client_unmute_volume_down, 1, 0),
SHELL_CMD_ARG(unmute_volume_up, NULL,
"Turn the volume up, and unmute",
cmd_vcs_client_unmute_volume_up, 1, 0),
cmd_vcp_client_unmute_volume_up, 1, 0),
SHELL_CMD_ARG(volume_set, NULL,
"Set an absolute volume <volume>",
cmd_vcs_client_volume_set, 2, 0),
cmd_vcp_client_volume_set, 2, 0),
SHELL_CMD_ARG(unmute, NULL,
"Unmute",
cmd_vcs_client_unmute, 1, 0),
cmd_vcp_client_unmute, 1, 0),
SHELL_CMD_ARG(mute, NULL,
"Mute",
cmd_vcs_client_mute, 1, 0),
cmd_vcp_client_mute, 1, 0),
SHELL_CMD_ARG(vocs_state_get, NULL,
"Get the offset state of a VOCS instance <inst_index>",
cmd_vcs_client_vocs_state_get, 2, 0),
cmd_vcp_client_vocs_state_get, 2, 0),
SHELL_CMD_ARG(vocs_location_get, NULL,
"Get the location of a VOCS instance <inst_index>",
cmd_vcs_client_vocs_location_get, 2, 0),
cmd_vcp_client_vocs_location_get, 2, 0),
SHELL_CMD_ARG(vocs_location_set, NULL,
"Set the location of a VOCS instance <inst_index> "
"<location>",
cmd_vcs_client_vocs_location_set, 3, 0),
cmd_vcp_client_vocs_location_set, 3, 0),
SHELL_CMD_ARG(vocs_offset_set, NULL,
"Set the offset for a VOCS instance <inst_index> "
"<offset>",
cmd_vcs_client_vocs_offset_set, 3, 0),
cmd_vcp_client_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_client_vocs_output_description_get, 2, 0),
cmd_vcp_client_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_client_vocs_output_description_set, 3, 0),
cmd_vcp_client_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_client_aics_input_state_get, 2, 0),
cmd_vcp_client_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_client_aics_gain_setting_get, 2, 0),
cmd_vcp_client_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_client_aics_input_type_get, 2, 0),
cmd_vcp_client_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_client_aics_input_status_get, 2, 0),
cmd_vcp_client_aics_input_status_get, 2, 0),
SHELL_CMD_ARG(aics_input_unmute, NULL,
"Unmute the input of a AICS instance <inst_index>",
cmd_vcs_client_aics_input_unmute, 2, 0),
cmd_vcp_client_aics_input_unmute, 2, 0),
SHELL_CMD_ARG(aics_input_mute, NULL,
"Mute the input of a AICS instance <inst_index>",
cmd_vcs_client_aics_input_mute, 2, 0),
cmd_vcp_client_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_client_aics_manual_input_gain_set, 2, 0),
cmd_vcp_client_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_client_aics_auto_input_gain_set, 2, 0),
cmd_vcp_client_aics_auto_input_gain_set, 2, 0),
SHELL_CMD_ARG(aics_gain_set, NULL,
"Set the gain of a AICS instance <inst_index> <gain>",
cmd_vcs_client_aics_gain_set, 3, 0),
cmd_vcp_client_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_client_aics_input_description_get, 2, 0),
cmd_vcp_client_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_client_aics_input_description_set, 3, 0),
cmd_vcp_client_aics_input_description_set, 3, 0),
SHELL_SUBCMD_SET_END
);
SHELL_CMD_ARG_REGISTER(vcs_client, &vcs_client_cmds,
"Bluetooth VCS client shell commands",
cmd_vcs_client, 1, 1);
SHELL_CMD_ARG_REGISTER(vcp_client, &vcp_client_cmds,
"Bluetooth VCP client shell commands",
cmd_vcp_client, 1, 1);