|
| 1 | +/** |
| 2 | + * @file |
| 3 | + * @brief Bluetooth Volume Offset Control Service (VOCS) APIs. |
| 4 | + */ |
| 5 | + |
1 | 6 | /* |
2 | | - * Copyright (c) 2020 Nordic Semiconductor ASA |
| 7 | + * Copyright (c) 2020-2024 Nordic Semiconductor ASA |
3 | 8 | * |
4 | 9 | * SPDX-License-Identifier: Apache-2.0 |
5 | 10 | */ |
|
36 | 41 | extern "C" { |
37 | 42 | #endif |
38 | 43 |
|
39 | | -/** Volume Offset Control Service Error codes */ |
| 44 | +/** |
| 45 | + * @name Volume Offset Control Service Error codes |
| 46 | + * @{ |
| 47 | + */ |
| 48 | +/** |
| 49 | + * The Change_Counter operand value does not match the Change_Counter field value of the Volume |
| 50 | + * Offset State characteristic. |
| 51 | + */ |
40 | 52 | #define BT_VOCS_ERR_INVALID_COUNTER 0x80 |
| 53 | +/** An invalid opcode has been used in a control point procedure. */ |
41 | 54 | #define BT_VOCS_ERR_OP_NOT_SUPPORTED 0x81 |
| 55 | +/** An operand value used in a control point procedure is outside the permissible range. */ |
42 | 56 | #define BT_VOCS_ERR_OUT_OF_RANGE 0x82 |
| 57 | +/** @} */ |
43 | 58 |
|
| 59 | +/** |
| 60 | + * @name Volume Offset Control Service offset limits |
| 61 | + * @{ |
| 62 | + */ |
| 63 | +/** Minimum offset value */ |
44 | 64 | #define BT_VOCS_MIN_OFFSET -255 |
| 65 | +/** Maximum offset value */ |
45 | 66 | #define BT_VOCS_MAX_OFFSET 255 |
| 67 | +/** @} */ |
46 | 68 |
|
47 | 69 | /** @brief Opaque Volume Offset Control Service instance. */ |
48 | 70 | struct bt_vocs; |
@@ -190,14 +212,32 @@ typedef void (*bt_vocs_description_cb)(struct bt_vocs *inst, int err, |
190 | 212 | */ |
191 | 213 | typedef void (*bt_vocs_discover_cb)(struct bt_vocs *inst, int err); |
192 | 214 |
|
| 215 | +/** |
| 216 | + * @brief Struct to hold the Volume Offset Control Service callbacks |
| 217 | + * |
| 218 | + * These can be registered for usage with bt_vocs_client_cb_register() or bt_vocs_register() |
| 219 | + * depending on the role. |
| 220 | + */ |
193 | 221 | struct bt_vocs_cb { |
| 222 | + /** The offset state has changed */ |
194 | 223 | bt_vocs_state_cb state; |
| 224 | + /** The location has changed */ |
195 | 225 | bt_vocs_location_cb location; |
| 226 | + /** The Description has changed */ |
196 | 227 | bt_vocs_description_cb description; |
197 | 228 |
|
198 | | -#if defined(CONFIG_BT_VOCS_CLIENT) |
199 | | - /* Client only */ |
| 229 | +#if defined(CONFIG_BT_VOCS_CLIENT) || defined(__DOXYGEN__) |
| 230 | + /** |
| 231 | + * The discovery procedure has completed |
| 232 | + * |
| 233 | + * Only settable for the client and requires enabling@kconfig{CONFIG_BT_VOCS_CLIENT}. |
| 234 | + */ |
200 | 235 | bt_vocs_discover_cb discover; |
| 236 | + /** |
| 237 | + * The set offset procedure has completed |
| 238 | + * |
| 239 | + * Only settable for the client and requires enabling@kconfig{CONFIG_BT_VOCS_CLIENT}. |
| 240 | + */ |
201 | 241 | bt_vocs_set_offset_cb set_offset; |
202 | 242 | #endif /* CONFIG_BT_VOCS_CLIENT */ |
203 | 243 | }; |
|
0 commit comments