Skip to content

Commit 425f3f4

Browse files
Thalleykartben
authored andcommitted
Bluetooth: Audio: Rename ctx type prohibited to none
The context type PROHIBITED has been removed from the Bluetooth assigned numbers document. It is, however, still used in some profiles to indicate either "No context type supported" or "None available", and thus a rename to "NONE" makes sense. It is still treating similar to prohibited in some cases, as it is not a valid context type in all cases. Signed-off-by: Emil Gydesen <[email protected]>
1 parent fa53d93 commit 425f3f4

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

doc/releases/migration-guide-4.2.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ Bluetooth Audio
297297
* ``bt_csip_set_member_get_sirk`` has been removed. Use :c:func:`bt_csip_set_member_get_info` to get
298298
the SIRK (and other information). (:github:`86996`)
299299

300+
* ``BT_AUDIO_CONTEXT_TYPE_PROHIBITED`` has been renamed to
301+
:c:enumerator:`BT_AUDIO_CONTEXT_TYPE_NONE`. (:github:`89506`)
302+
300303
Bluetooth HCI
301304
=============
302305

include/zephyr/bluetooth/audio/audio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ enum bt_audio_codec_cfg_frame_dur {
301301
* These values are defined by the Generic Audio Assigned Numbers, bluetooth.com
302302
*/
303303
enum bt_audio_context {
304-
/** Prohibited */
305-
BT_AUDIO_CONTEXT_TYPE_PROHIBITED = 0,
304+
/** No context type */
305+
BT_AUDIO_CONTEXT_TYPE_NONE = 0,
306306
/**
307307
* Identifies audio where the use case context does not match any other defined value,
308308
* or where the context is unknown or cannot be determined.
@@ -2099,8 +2099,8 @@ int bt_audio_codec_cap_meta_set_vendor(struct bt_audio_codec_cap *codec_cap,
20992099
static inline char *bt_audio_context_bit_to_str(enum bt_audio_context context)
21002100
{
21012101
switch (context) {
2102-
case BT_AUDIO_CONTEXT_TYPE_PROHIBITED:
2103-
return "Prohibited";
2102+
case BT_AUDIO_CONTEXT_TYPE_NONE:
2103+
return "None";
21042104
case BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED:
21052105
return "Unspecified";
21062106
case BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL:

include/zephyr/bluetooth/audio/pacs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ int bt_pacs_conn_set_available_contexts_for_conn(struct bt_conn *conn, enum bt_a
213213
* @param dir Direction of the endpoints to get contexts for.
214214
*
215215
* @return Bitmask of available contexts.
216-
* @retval BT_AUDIO_CONTEXT_TYPE_PROHIBITED if @p conn or @p dir are invalid
216+
* @retval BT_AUDIO_CONTEXT_TYPE_NONE if @p conn or @p dir are invalid
217217
*/
218218
enum bt_audio_context bt_pacs_get_available_contexts_for_conn(struct bt_conn *conn,
219219
enum bt_audio_dir dir);

subsys/bluetooth/audio/ascs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ static bool ascs_parse_metadata(struct bt_data *data, void *user_data)
21472147
}
21482148

21492149
context = sys_get_le16(data_value);
2150-
if (context == BT_AUDIO_CONTEXT_TYPE_PROHIBITED) {
2150+
if (context == BT_AUDIO_CONTEXT_TYPE_NONE) {
21512151
*result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID,
21522152
data_type);
21532153
result->err = -EINVAL;

subsys/bluetooth/audio/pacs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ static uint32_t pacs_snk_location;
6464
#endif /* CONFIG_BT_PAC_SNK_LOC */
6565
#endif /* CONFIG_BT_PAC_SNK */
6666

67-
static uint16_t src_available_contexts = BT_AUDIO_CONTEXT_TYPE_PROHIBITED;
68-
static uint16_t snk_available_contexts = BT_AUDIO_CONTEXT_TYPE_PROHIBITED;
67+
static uint16_t src_available_contexts = BT_AUDIO_CONTEXT_TYPE_NONE;
68+
static uint16_t snk_available_contexts = BT_AUDIO_CONTEXT_TYPE_NONE;
6969

7070
enum {
7171
FLAG_ACTIVE,
@@ -308,7 +308,7 @@ static uint16_t supported_context_get(enum bt_audio_dir dir)
308308
break;
309309
}
310310

311-
return BT_AUDIO_CONTEXT_TYPE_PROHIBITED;
311+
return BT_AUDIO_CONTEXT_TYPE_NONE;
312312
}
313313

314314
static ssize_t supported_context_read(struct bt_conn *conn,
@@ -1561,15 +1561,15 @@ enum bt_audio_context bt_pacs_get_available_contexts(enum bt_audio_dir dir)
15611561
break;
15621562
}
15631563

1564-
return BT_AUDIO_CONTEXT_TYPE_PROHIBITED;
1564+
return BT_AUDIO_CONTEXT_TYPE_NONE;
15651565
}
15661566

15671567
enum bt_audio_context bt_pacs_get_available_contexts_for_conn(struct bt_conn *conn,
15681568
enum bt_audio_dir dir)
15691569
{
15701570
CHECKIF(conn == NULL) {
15711571
LOG_ERR("NULL conn");
1572-
return BT_AUDIO_CONTEXT_TYPE_PROHIBITED;
1572+
return BT_AUDIO_CONTEXT_TYPE_NONE;
15731573
}
15741574

15751575
return pacs_get_available_contexts_for_conn(conn, dir);

subsys/bluetooth/audio/shell/bap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3724,7 +3724,7 @@ static int cmd_context(const struct shell *sh, size_t argc, char *argv[])
37243724
ctx = ctx_val;
37253725

37263726
if (!strcmp(argv[3], "supported")) {
3727-
if (ctx_val == BT_AUDIO_CONTEXT_TYPE_PROHIBITED) {
3727+
if (ctx_val == BT_AUDIO_CONTEXT_TYPE_NONE) {
37283728
shell_error(sh, "Invalid context: %lu", ctx_val);
37293729

37303730
return -ENOEXEC;

0 commit comments

Comments
 (0)