avdtp: return error in avdtp_suspend_stream if state is not streaming

This commit is contained in:
Matthias Ringwald 2023-12-12 15:24:38 +01:00
parent 84ad4212a9
commit 9cb061cb22
2 changed files with 6 additions and 1 deletions

View File

@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- AVDTP: limit L2CAP MTU to largest BR/EDR packet, fixes A2DP Sink role for some Samsung TV
- AVDTP: fix Get Stream Configuration
- AVDTP: reject suspend in state endpoint open
- AVDTP: return error in avdtp_suspend_stream if state is not streaming
- AVRCP: reject incoming second l2cap connection
- AVRCP: generate command for avrcp_controller_get_element_attributes dynamically
- SPP Server: fix SPP version in SDP record

View File

@ -1300,7 +1300,11 @@ uint8_t avdtp_suspend_stream(uint16_t avdtp_cid, uint8_t local_seid){
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
}
if (!is_avdtp_remote_seid_registered(stream_endpoint) || stream_endpoint->suspend_stream){
if (!is_avdtp_remote_seid_registered(stream_endpoint)){
return ERROR_CODE_COMMAND_DISALLOWED;
}
if (stream_endpoint->state != AVDTP_STREAM_ENDPOINT_STREAMING){
return ERROR_CODE_COMMAND_DISALLOWED;
}