shared/bap: Fix line over 80 columns in set_base_subgroup
Luiz Augusto von Dentz
maintainerPATCH 1/3 shared/bap: Fix line over 80 columns in set_base_subgroup
From: Luiz Augusto von Dentz <[email protected]>
Replace the tab between the compare_ltv() arguments with a space.
--- src/shared/bap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/shared/bap.c +1 -1
@@ -7557,7 +7557,7 @@ static void set_base_subgroup(void *data, void *user_data)for (entry =queue_get_entries (base->subgroups); entry; entry = entry->next) { subgroup = entry->data; - same_meta =compare_ltv (subgroup->meta, stream->meta); + same_meta =compare_ltv (subgroup->meta, stream->meta);if (same_meta)break ; }
Signature · 1 line
2.56.0
Luiz Augusto von Dentz
maintainerPATCH 2/3 shared/bap: Move LTV type defines to bap-defs.h
From: Luiz Augusto von Dentz <[email protected]>
Replace the BAP_*_LTV_TYPE defines private to bap.c with BT_BAP_CAP_*, BT_BAP_CC_* and BT_BAP_META_* in bap-defs.h, covering every type in Assigned Numbers 6.12.4, 6.12.5 and 6.12.6, and use them in the bap-debug.c LTV tables.
Add bap-debug.c decoders for the metadata types that had none: CCID_List, Parental_Rating, Program_Info_URI, Audio_Active_State, Broadcast_Audio_Immediate_Rendering_Flag, Assisted_Listening_Stream, Broadcast_Name, Extended_Metadata and Vendor_Specific.
--- src/shared/bap-debug.c | 209 ++++++++++++++++++++++++++++++++++++++--- src/shared/bap-defs.h | 52 ++++++++++ src/shared/bap.c | 33 +++---- 3 files changed, 259 insertions(+), 35 deletions(-)
src/shared/bap-debug.c +195 -14
@@ -15,6 +15,7 @@#include <errno.h> #include "src/shared/util.h" +#include "src/shared/bap-defs.h" #include "src/shared/bap-debug.h" static const struct util_bit_debugger pac_freq_table[] = {
@@ -185,11 +186,11 @@ done: }static const struct util_ltv_debugger pac_cap_table[] = { -UTIL_LTV_DEBUG (0x01 , pac_debug_freq), -UTIL_LTV_DEBUG (0x02 , pac_debug_duration), -UTIL_LTV_DEBUG (0x03 , pac_debug_channels), -UTIL_LTV_DEBUG (0x04 , pac_debug_frame_length), -UTIL_LTV_DEBUG (0x05 , pac_debug_sdu) +UTIL_LTV_DEBUG (BT_BAP_CAP_FREQ , pac_debug_freq), +UTIL_LTV_DEBUG (BT_BAP_CAP_DURATION , pac_debug_duration), +UTIL_LTV_DEBUG (BT_BAP_CAP_CHANNELS , pac_debug_channels), +UTIL_LTV_DEBUG (BT_BAP_CAP_FRAME_LENGTH , pac_debug_frame_length), +UTIL_LTV_DEBUG (BT_BAP_CAP_SDU , pac_debug_sdu) }; bool bt_bap_debug_caps(void *data, size_t len, util_debug_func_t func,
@@ -414,11 +415,11 @@ done: }static const struct util_ltv_debugger ase_cc_table[] = { -UTIL_LTV_DEBUG (0x01 , ase_debug_freq), -UTIL_LTV_DEBUG (0x02 , ase_debug_duration), -UTIL_LTV_DEBUG (0x03 , ase_debug_location), -UTIL_LTV_DEBUG (0x04 , ase_debug_frame_length), -UTIL_LTV_DEBUG (0x05 , ase_debug_blocks) +UTIL_LTV_DEBUG (BT_BAP_CC_FREQ , ase_debug_freq), +UTIL_LTV_DEBUG (BT_BAP_CC_DURATION , ase_debug_duration), +UTIL_LTV_DEBUG (BT_BAP_CC_LOCATION , ase_debug_location), +UTIL_LTV_DEBUG (BT_BAP_CC_FRAME_LENGTH , ase_debug_frame_length), +UTIL_LTV_DEBUG (BT_BAP_CC_SDU , ase_debug_blocks) }; bool bt_bap_debug_config(void *data, size_t len, util_debug_func_t func,
@@ -527,11 +528,191 @@ done: user_data); } +static void debug_string (const char *label,const uint8_t *data, +uint8_t len,util_debug_func_t func, +void *user_data) +{ +util_debug (func, user_data,"%s: %.*s" , label, len, (const char *)data); +} + +static void ase_debug_ccid_list (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +uint8_t i; + +util_debug (func, user_data,"CCID List: %u entries" , len); + +for (i =0 ; i < len; i++) +util_debug (func, user_data,"\tCCID: %u" , data[i]); +} + +static void ase_debug_parental_rating (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +struct iovec frame = { (void *)data, len }; +uint8_t value; + +if (!util_iov_pull_u8 (&frame, &value)) { +util_debug (func, user_data,"value: invalid size" ); + goto done; + } + +switch (value &0x0f ) { +case 0x00 : +util_debug (func, user_data, +"Parental Rating: No rating (0x%2.2x)" , value); +break ; +case 0x01 : +util_debug (func, user_data, +"Parental Rating: Any age (0x%2.2x)" , value); +break ; +default : +util_debug (func, user_data, +"Parental Rating: Age %u or older (0x%2.2x)" , + (value &0x0f ) +3 , value); +break ; + } + +done: +if (frame.iov_len) +util_hexdump (' ' , frame.iov_base, frame.iov_len, func, + user_data); +} + +static void ase_debug_program_info_uri (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +debug_string ("Program Info URI" , data, len, func, user_data); +} + +static void ase_debug_audio_active_state (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +struct iovec frame = { (void *)data, len }; +uint8_t value; + +if (!util_iov_pull_u8 (&frame, &value)) { +util_debug (func, user_data,"value: invalid size" ); + goto done; + } + +switch (value) { +case 0x00 : +util_debug (func, user_data, +"Audio Active State: No audio data (0x00)" ); +break ; +case 0x01 : +util_debug (func, user_data, +"Audio Active State: Audio data (0x01)" ); +break ; +default : +util_debug (func, user_data, +"Audio Active State: RFU (0x%2.2x)" , value); +break ; + } + +done: +if (frame.iov_len) +util_hexdump (' ' , frame.iov_base, frame.iov_len, func, + user_data); +} + +static void ase_debug_bcast_immediate (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +util_debug (func, user_data,"Broadcast Audio Immediate Rendering" ); + +if (len) +util_hexdump (' ' , data, len, func, user_data); +} + +static void ase_debug_assisted_listening (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +struct iovec frame = { (void *)data, len }; +uint8_t value; + +if (!util_iov_pull_u8 (&frame, &value)) { +util_debug (func, user_data,"value: invalid size" ); + goto done; + } + +if (value ==0x00 ) +util_debug (func, user_data,"Assisted Listening Stream: " +"Unspecified audio enhancement (0x00)" ); +else +util_debug (func, user_data, +"Assisted Listening Stream: RFU (0x%2.2x)" , + value); + +done: +if (frame.iov_len) +util_hexdump (' ' , frame.iov_base, frame.iov_len, func, + user_data); +} + +static void ase_debug_broadcast_name (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +debug_string ("Broadcast Name" , data, len, func, user_data); +} + +static void ase_debug_extended (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +struct iovec frame = { (void *)data, len }; +uint16_t value; + +if (!util_iov_pull_le16 (&frame, &value)) { +util_debug (func, user_data,"value: invalid size" ); + goto done; + } + +util_debug (func, user_data,"Extended Metadata Type: 0x%4.4x" , value); + +done: +if (frame.iov_len) +util_hexdump (' ' , frame.iov_base, frame.iov_len, func, + user_data); +} + +static void ase_debug_vendor (const uint8_t *data,uint8_t len, +util_debug_func_t func,void *user_data) +{ +struct iovec frame = { (void *)data, len }; +uint16_t value; + +if (!util_iov_pull_le16 (&frame, &value)) { +util_debug (func, user_data,"value: invalid size" ); + goto done; + } + +util_debug (func, user_data,"Company ID: 0x%4.4x" , value); + +done: +if (frame.iov_len) +util_hexdump (' ' , frame.iov_base, frame.iov_len, func, + user_data); +} +static const struct util_ltv_debugger ase_metadata_table[] = { -UTIL_LTV_DEBUG (0x01 , ase_debug_preferred_context), -UTIL_LTV_DEBUG (0x02 , ase_debug_context), -UTIL_LTV_DEBUG (0x03 , ase_debug_program_info), -UTIL_LTV_DEBUG (0x04 , ase_debug_language) +UTIL_LTV_DEBUG (BT_BAP_META_PREFERRED_CONTEXT , + ase_debug_preferred_context), +UTIL_LTV_DEBUG (BT_BAP_META_CONTEXT , ase_debug_context), +UTIL_LTV_DEBUG (BT_BAP_META_PROGRAM_INFO , ase_debug_program_info), +UTIL_LTV_DEBUG (BT_BAP_META_LANGUAGE , ase_debug_language), +UTIL_LTV_DEBUG (BT_BAP_META_CCID_LIST , ase_debug_ccid_list), +UTIL_LTV_DEBUG (BT_BAP_META_PARENTAL_RATING , ase_debug_parental_rating), +UTIL_LTV_DEBUG (BT_BAP_META_PROGRAM_INFO_URI , + ase_debug_program_info_uri), +UTIL_LTV_DEBUG (BT_BAP_META_AUDIO_ACTIVE_STATE , + ase_debug_audio_active_state), +UTIL_LTV_DEBUG (BT_BAP_META_BCAST_IMMEDIATE , ase_debug_bcast_immediate), +UTIL_LTV_DEBUG (BT_BAP_META_ASSISTED_LISTENING , + ase_debug_assisted_listening), +UTIL_LTV_DEBUG (BT_BAP_META_BROADCAST_NAME , ase_debug_broadcast_name), +UTIL_LTV_DEBUG (BT_BAP_META_EXTENDED , ase_debug_extended), +UTIL_LTV_DEBUG (BT_BAP_META_VENDOR , ase_debug_vendor) }; bool bt_bap_debug_metadata(void *data, size_t len, util_debug_func_t func,
src/shared/bap-defs.h +52 -0
58 lines not on this page · raw message
src/shared/bap.c +12 -21
@@ -49,19 +49,10 @@#define BAP_PROCESS_TIMEOUT 10 -#define BAP_FREQ_LTV_TYPE 1 -#define BAP_DURATION_LTV_TYPE 2 -#define BAP_CHANNEL_ALLOCATION_LTV_TYPE 3 -#define BAP_FRAME_LEN_LTV_TYPE 4#define CODEC_SPECIFIC_CONFIGURATION_MASK (\ - (1<<BAP_FREQ_LTV_TYPE)|\ - (1<<BAP_DURATION_LTV_TYPE)|\ - (1<<BAP_FRAME_LEN_LTV_TYPE)) - -#define BAP_METADATA_PREF_CONTEXT_LTV_TYPE 0x01 -#define BAP_METADATA_CONTEXT_LTV_TYPE 0x02 -#define BAP_METADATA_PROGRAM_INFO_LTV_TYPE 0x03 -#define BAP_METADATA_LANGUAGE_LTV_TYPE 0x04 + (1<<BT_BAP_CC_FREQ)|\ + (1<<BT_BAP_CC_DURATION)|\ + (1<<BT_BAP_CC_FRAME_LENGTH))struct bt_bap_pac_changed {unsigned int id;
@@ -2569,7 +2560,7 @@ static void bap_sink_get_allocation(size_t i, uint8_t l, uint8_t t,static unsigned int bap_bcast_get_location (struct bt_bap_stream *stream) { -uint8_t type =BAP_CHANNEL_ALLOCATION_LTV_TYPE ; +uint8_t type =BT_BAP_CC_LOCATION ;uint32_t allocation =0 ;struct iovec *caps;
@@ -3432,9 +3423,9 @@ static void bap_metadata_process(size_t i, uint8_t l, uint8_t t, uint8_t *v,uint16_t context;switch (t) { -case BAP_METADATA_PREF_CONTEXT_LTV_TYPE : +case BT_BAP_META_PREFERRED_CONTEXT :break ; -case BAP_METADATA_CONTEXT_LTV_TYPE : +case BT_BAP_META_CONTEXT :if (l !=sizeof (context)) {ascs_ase_rsp_add (data->rsp, data->ep->id,BT_ASCS_RSP_METADATA_INVALID , t);
@@ -3450,8 +3441,8 @@ static void bap_metadata_process(size_t i, uint8_t l, uint8_t t, uint8_t *v, }break ; -case BAP_METADATA_PROGRAM_INFO_LTV_TYPE : -case BAP_METADATA_LANGUAGE_LTV_TYPE : +case BT_BAP_META_PROGRAM_INFO : +case BT_BAP_META_LANGUAGE :break ;default : ascs_ase_rsp_add(data->rsp, data->ep->id,
@@ -7649,17 +7640,17 @@ static void check_pac_caps_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v,uint16_t frame_len;switch (t) { -case BAP_FREQ_LTV_TYPE : +case BT_BAP_CAP_FREQ : mask =get_le16 (v);if (mask & (1 << (bis_v[0 ] -1 ))) compare_data->data32 |=1 <<t;break ; -case BAP_DURATION_LTV_TYPE : +case BT_BAP_CAP_DURATION :if ((v[0 ]) & (1 << bis_v[0 ])) compare_data->data32 |=1 <<t;break ; -case BAP_FRAME_LEN_LTV_TYPE : +case BT_BAP_CAP_FRAME_LENGTH : min =get_le16 (v); max =get_le16 (v +2 ); frame_len =get_le16 (bis_v);
@@ -7798,7 +7789,7 @@ static struct bt_ltv_match bap_check_bis(uint32_t sink_loc, struct queue *pacs, compare_data.found = true;if (sink_loc) { -uint8_t type =BAP_CHANNEL_ALLOCATION_LTV_TYPE ; +uint8_t type =BT_BAP_CC_LOCATION ; compare_data.data32 = sink_loc; util_ltv_foreach(bis_data->iov_base, bis_data->iov_len, &type,
Signature · 1 line
2.56.0
Luiz Augusto von Dentz
maintainerPATCH 3/3 shared/bap: Accept all defined metadata types
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
bap_metadata_process() rejected every metadata type other than Preferred/Streaming_Audio_Contexts, Program_Info and Language with Unsupported Metadata, so valid LTVs such as CCID_List, which the Client must include for content control, caused Enable and Update Metadata to fail.
Accept all types defined in Assigned Numbers 6.12.6, and reject Parental_Rating, Audio_Active_State and Assisted_Listening_Stream as Invalid Metadata when their value is not 1 octet.
--- src/shared/bap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
src/shared/bap.c +15 -0
@@ -3443,6 +3443,21 @@ static void bap_metadata_process(size_t i, uint8_t l, uint8_t t, uint8_t *v,break ;case BT_BAP_META_PROGRAM_INFO :case BT_BAP_META_LANGUAGE : +case BT_BAP_META_CCID_LIST : +case BT_BAP_META_PROGRAM_INFO_URI : +case BT_BAP_META_BCAST_IMMEDIATE : +case BT_BAP_META_BROADCAST_NAME : +case BT_BAP_META_EXTENDED : +case BT_BAP_META_VENDOR : +break ; +case BT_BAP_META_PARENTAL_RATING : +case BT_BAP_META_AUDIO_ACTIVE_STATE : +case BT_BAP_META_ASSISTED_LISTENING : +if (l !=sizeof (uint8_t )) { +ascs_ase_rsp_add (data->rsp, data->ep->id, +BT_ASCS_RSP_METADATA_INVALID , t); + data->err =BT_ASCS_RSP_METADATA_INVALID ; + }break ;default : ascs_ase_rsp_add(data->rsp, data->ep->id,
Signature · 1 line
2.56.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1195473/
---Test result---
Test Summary:
CheckPatch PASS 1.47 seconds GitLint PASS 1.14 seconds BuildEll PASS 18.33 seconds BluezMake PASS 273.41 seconds MakeCheck PASS 12.64 seconds MakeDistcheck PASS 136.81 seconds CheckValgrind PASS 199.99 seconds CheckSmatch WARNING 231.43 seconds bluezmakeextell PASS 88.60 seconds TestFunctional PASS 1060.41 seconds IncrementalBuild PASS 319.17 seconds ScanBuild PASS 932.22 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:src/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:309:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
https://github.com/bluez/bluez/pull/2731
---
Regards,
Linux Bluetooth
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 8 lines · On Wed, 28 Oct 2026 09:55:15 -0400 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
Replace the tab between the
compare_ltv()arguments with a space.Assisted-by OpenCode:claude-opus-5.5--- src/shared/bap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [BlueZ,v1,1/3] shared/bap: Fix line over 80 columns in set_base_subgroup
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a1a423e2ef3b
- [BlueZ,v1,2/3] shared/bap: Move LTV type defines to bap-defs.h (no matching commit)
- [BlueZ,v1,3/3] shared/bap: Accept all defined metadata types (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
This is an automated email and please do not reply to this email.
Dear Submitter,
This series was picked up by the CI more than 2 weeks ago and the pull request created for it is still open, which means the series was never applied to the tree.
Series: [BlueZ,v1,1/3] shared/bap: Fix line over 80 columns in set_base_subgroup
Pull Request: https://github.com/bluez/bluez/pull/2731
Created: 2026-10-28 15:20:57+00:00
The pull request has been closed and no further action is taken on this series.
If the change should still be considered, it must be resent to the Linux Bluetooth mailing list ([email protected]) so that it is picked up again.
---
Regards,
Linux Bluetooth