mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
hfp/goep_client/avdtp/a2dp: return SDP_SERVICE_NOT_FOUND
if no suitable SDP record is found
This commit is contained in:
parent
8580489cbd
commit
cc92f22bee
@ -16,6 +16,9 @@ HFP AG/HSP AG: avoid connecting to remote service with same role
|
||||
### Fixed
|
||||
L2CAP: fix packet size check for incoming classic basic channels (regression introduced in v1.2.1)
|
||||
|
||||
### Changed
|
||||
HFP/GOEP Client/AVDTP/A2DP: return `SDP_SERVICE_NOT_FOUND` if no suitable SDP record is found
|
||||
|
||||
## Release v1.2.1
|
||||
|
||||
### Fixed
|
||||
|
@ -623,12 +623,8 @@ static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t c
|
||||
case SDP_EVENT_QUERY_COMPLETE:
|
||||
status = sdp_event_query_complete_get_status(packet);
|
||||
if (status != ERROR_CODE_SUCCESS) break;
|
||||
if (!connection->sink_supported) {
|
||||
status = ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
|
||||
break;
|
||||
}
|
||||
if (connection->avdtp_l2cap_psm == 0) {
|
||||
status = ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
|
||||
if (!connection->sink_supported || (connection->avdtp_l2cap_psm == 0)) {
|
||||
status = SDP_SERVICE_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -645,12 +641,8 @@ static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t c
|
||||
case SDP_EVENT_QUERY_COMPLETE:
|
||||
status = sdp_event_query_complete_get_status(packet);
|
||||
if (status != ERROR_CODE_SUCCESS) break;
|
||||
if (!connection->source_supported) {
|
||||
status = ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
|
||||
break;
|
||||
}
|
||||
if (connection->avdtp_l2cap_psm == 0) {
|
||||
status = ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE;
|
||||
if (!connection->source_supported || (connection->avdtp_l2cap_psm == 0)) {
|
||||
status = SDP_SERVICE_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -666,6 +658,7 @@ static void avdtp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t c
|
||||
avdtp_handle_sdp_client_query_attribute_value(connection, packet);
|
||||
return;
|
||||
case SDP_EVENT_QUERY_COMPLETE:
|
||||
// without suitable SDP Record, avdtp version v0.0 is assumed
|
||||
status = sdp_event_query_complete_get_status(packet);
|
||||
break;
|
||||
default:
|
||||
|
@ -326,7 +326,7 @@ static void goep_client_handle_sdp_query_event(uint8_t packet_type, uint16_t cha
|
||||
if ((context->rfcomm_port == 0) && (context->l2cap_psm == 0)){
|
||||
log_info("No GOEP RFCOMM or L2CAP server found");
|
||||
context->state = GOEP_INIT;
|
||||
goep_client_emit_connected_event(goep_client, ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE);
|
||||
goep_client_emit_connected_event(goep_client, SDP_SERVICE_NOT_FOUND);
|
||||
break;
|
||||
}
|
||||
#ifdef ENABLE_GOEP_L2CAP
|
||||
|
@ -612,8 +612,13 @@ static void handle_query_rfcomm_event(uint8_t packet_type, uint16_t channel, uin
|
||||
|
||||
} else {
|
||||
hfp_connection->state = HFP_IDLE;
|
||||
hfp_emit_slc_connection_event(hfp_connection, sdp_event_query_complete_get_status(packet), HCI_CON_HANDLE_INVALID, hfp_connection->remote_addr);
|
||||
log_info("rfcomm service not found, status 0x%02x", sdp_event_query_complete_get_status(packet));
|
||||
uint8_t status = sdp_event_query_complete_get_status(packet);
|
||||
if (status == ERROR_CODE_SUCCESS){
|
||||
// report service not found
|
||||
status = SDP_SERVICE_NOT_FOUND;
|
||||
}
|
||||
hfp_emit_slc_connection_event(hfp_connection, status, HCI_CON_HANDLE_INVALID, hfp_connection->remote_addr);
|
||||
log_info("rfcomm service not found, status 0x%02x", status);
|
||||
}
|
||||
|
||||
// register the SDP Query request to check if there is another connection waiting for the query
|
||||
|
Loading…
x
Reference in New Issue
Block a user