|
| 1 | +/** |
| 2 | + * @file |
| 3 | + * @brief Bluetooth Volume Control Profile (VCP) APIs. |
| 4 | + */ |
| 5 | + |
1 | 6 | /* |
2 | | - * Copyright (c) 2020-2022 Nordic Semiconductor ASA |
| 7 | + * Copyright (c) 2020-2024 Nordic Semiconductor ASA |
3 | 8 | * |
4 | 9 | * SPDX-License-Identifier: Apache-2.0 |
5 | 10 | */ |
|
17 | 22 | * |
18 | 23 | * @ingroup bluetooth |
19 | 24 | * @{ |
| 25 | + * |
| 26 | + * The Volume Control Profile (VCP) provides procedures to control the volume level and mute state |
| 27 | + * on audio devices. |
20 | 28 | */ |
21 | 29 |
|
22 | 30 | #include <stdint.h> |
|
30 | 38 | extern "C" { |
31 | 39 | #endif |
32 | 40 |
|
| 41 | +/** |
| 42 | + * Defines the maximum number of Volume Offset Control service instances for the |
| 43 | + * Volume Control Profile Volume Renderer |
| 44 | + */ |
33 | 45 | #if defined(CONFIG_BT_VCP_VOL_REND) |
34 | 46 | #define BT_VCP_VOL_REND_VOCS_CNT CONFIG_BT_VCP_VOL_REND_VOCS_INSTANCE_COUNT |
35 | | -#define BT_VCP_VOL_REND_AICS_CNT CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT |
36 | 47 | #else |
37 | 48 | #define BT_VCP_VOL_REND_VOCS_CNT 0 |
| 49 | +#endif /* CONFIG_BT_VCP_VOL_REND */ |
| 50 | + |
| 51 | +/** |
| 52 | + * Defines the maximum number of Audio Input Control service instances for the |
| 53 | + * Volume Control Profile Volume Renderer |
| 54 | + */ |
| 55 | +#if defined(CONFIG_BT_VCP_VOL_REND) |
| 56 | +#define BT_VCP_VOL_REND_AICS_CNT CONFIG_BT_VCP_VOL_REND_AICS_INSTANCE_COUNT |
| 57 | +#else |
38 | 58 | #define BT_VCP_VOL_REND_AICS_CNT 0 |
39 | 59 | #endif /* CONFIG_BT_VCP_VOL_REND */ |
40 | 60 |
|
41 | | -/** Volume Control Service Error codes */ |
| 61 | +/** |
| 62 | + * @name Volume Control Service Error codes |
| 63 | + * @{ |
| 64 | + */ |
| 65 | +/** |
| 66 | + * The Change_Counter operand value does not match the Change_Counter field value of the Volume |
| 67 | + * State characteristic. |
| 68 | + */ |
42 | 69 | #define BT_VCP_ERR_INVALID_COUNTER 0x80 |
| 70 | +/** An invalid opcode has been used in a control point procedure. */ |
43 | 71 | #define BT_VCP_ERR_OP_NOT_SUPPORTED 0x81 |
| 72 | +/** @} */ |
44 | 73 |
|
45 | | -/** Volume Control Service Mute Values */ |
| 74 | +/** |
| 75 | + * @name Volume Control Service Mute Values |
| 76 | + * @{ |
| 77 | + */ |
| 78 | +/** The volume state is unmuted */ |
46 | 79 | #define BT_VCP_STATE_UNMUTED 0x00 |
| 80 | +/** The volume state is muted */ |
47 | 81 | #define BT_VCP_STATE_MUTED 0x01 |
| 82 | +/** @} */ |
48 | 83 |
|
49 | 84 | /** @brief Opaque Volume Control Service instance. */ |
50 | 85 | struct bt_vcp_vol_ctlr; |
@@ -115,6 +150,11 @@ int bt_vcp_vol_rend_included_get(struct bt_vcp_included *included); |
115 | 150 | */ |
116 | 151 | int bt_vcp_vol_rend_register(struct bt_vcp_vol_rend_register_param *param); |
117 | 152 |
|
| 153 | +/** |
| 154 | + * @brief Struct to hold the Volume Renderer callbacks |
| 155 | + * |
| 156 | + * These can be registered for usage with bt_vcp_vol_rend_register(). |
| 157 | + */ |
118 | 158 | struct bt_vcp_vol_rend_cb { |
119 | 159 | /** |
120 | 160 | * @brief Callback function for Volume Control Service volume state. |
@@ -223,6 +263,11 @@ int bt_vcp_vol_rend_unmute(void); |
223 | 263 | */ |
224 | 264 | int bt_vcp_vol_rend_mute(void); |
225 | 265 |
|
| 266 | +/** |
| 267 | + * @brief Struct to hold the Volume Controller callbacks |
| 268 | + * |
| 269 | + * These can be registered for usage with bt_vcp_vol_ctlr_cb_register(). |
| 270 | + */ |
226 | 271 | struct bt_vcp_vol_ctlr_cb { |
227 | 272 | /** |
228 | 273 | * @brief Callback function for Volume Control Profile volume state. |
@@ -350,13 +395,13 @@ struct bt_vcp_vol_ctlr_cb { |
350 | 395 | */ |
351 | 396 | void (*vol_set)(struct bt_vcp_vol_ctlr *vol_ctlr, int err); |
352 | 397 |
|
353 | | - /* Volume Offset Control Service callbacks */ |
| 398 | + /** Volume Offset Control Service callbacks */ |
354 | 399 | struct bt_vocs_cb vocs_cb; |
355 | 400 |
|
356 | | - /* Audio Input Control Service callbacks */ |
| 401 | + /** Audio Input Control Service callbacks */ |
357 | 402 | struct bt_aics_cb aics_cb; |
358 | 403 |
|
359 | | - /** Internally used field for list handling */ |
| 404 | + /** @internal Internally used field for list handling */ |
360 | 405 | sys_snode_t _node; |
361 | 406 | }; |
362 | 407 |
|
|
0 commit comments