Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/classic/avdtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@
}
}

static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){

Check failure on line 700 in src/classic/avdtp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 26 to the 25 allowed.

See more on https://sonarcloud.io/project/issues?id=bluekitchen_btstack&issues=AZ0aTA2vqzmSGmbxGkFL&open=AZ0aTA2vqzmSGmbxGkFL&pullRequest=634
UNUSED(packet_type);
UNUSED(channel);
UNUSED(size);
Expand All @@ -724,7 +724,7 @@
}
break;
default:
btstack_assert(false);

Check warning on line 727 in src/classic/avdtp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Modify the macro definition so that it needs to be followed by a semicolon, or remove this empty statement.

See more on https://sonarcloud.io/project/issues?id=bluekitchen_btstack&issues=AZ0aTA2vqzmSGmbxGkFM&open=AZ0aTA2vqzmSGmbxGkFM&pullRequest=634
return;
}
break;
Expand All @@ -742,7 +742,7 @@
}
break;
default:
btstack_assert(false);

Check warning on line 745 in src/classic/avdtp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Modify the macro definition so that it needs to be followed by a semicolon, or remove this empty statement.

See more on https://sonarcloud.io/project/issues?id=bluekitchen_btstack&issues=AZ0aTA2vqzmSGmbxGkFN&open=AZ0aTA2vqzmSGmbxGkFN&pullRequest=634
return;
}
break;
Expand Down Expand Up @@ -861,9 +861,7 @@
}

stream_endpoint = avdtp_get_stream_endpoint_for_l2cap_cid(channel);
if (!stream_endpoint){
if (!connection) break;
handle_l2cap_data_packet_for_signaling_connection(connection, packet, size);
if (stream_endpoint == NULL){
break;
}

Expand Down Expand Up @@ -1553,7 +1551,7 @@
if (!stream_endpoint) return 0;
return stream_endpoint->sep.seid;
}
uint8_t avdtp_choose_sbc_subbands(avdtp_stream_endpoint_t * stream_endpoint, uint8_t remote_subbands_bitmap){

Check warning on line 1554 in src/classic/avdtp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "stream_endpoint" is "struct avdtp_stream_endpoint *".

See more on https://sonarcloud.io/project/issues?id=bluekitchen_btstack&issues=AZ0aTA2vqzmSGmbxGkFO&open=AZ0aTA2vqzmSGmbxGkFO&pullRequest=634
if (!stream_endpoint) return 0;
uint8_t * media_codec = stream_endpoint->sep.capabilities.media_codec.media_codec_information;
uint8_t subbands_bitmap = ((media_codec[1] >> 2) & 0x03) & remote_subbands_bitmap;
Expand All @@ -1567,7 +1565,7 @@
return subbands;
}

uint8_t avdtp_choose_sbc_block_length(avdtp_stream_endpoint_t * stream_endpoint, uint8_t remote_block_length_bitmap){

Check warning on line 1568 in src/classic/avdtp.c

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make the type of this parameter a pointer-to-const. The current type of "stream_endpoint" is "struct avdtp_stream_endpoint *".

See more on https://sonarcloud.io/project/issues?id=bluekitchen_btstack&issues=AZ0aTA2vqzmSGmbxGkFP&open=AZ0aTA2vqzmSGmbxGkFP&pullRequest=634
if (!stream_endpoint) return 0;
uint8_t * media_codec = stream_endpoint->sep.capabilities.media_codec.media_codec_information;
uint8_t block_length_bitmap = (media_codec[1] >> 4) & remote_block_length_bitmap;
Expand Down