hsp_hs: fix disconnect if audio not connected

This commit is contained in:
Matthias Ringwald 2020-05-17 22:50:49 +02:00
parent 9dc32eb425
commit 08ecd8bd8c
2 changed files with 3 additions and 14 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- sm: fix secure connection pairing as peripheral when local user confirmation happens after remote one
- A2DP Source: only connect to remote sink stream endpoints
- btstack_hal_flash_memory: fix write of 0xff bytes to simulated flash
- hsp_hs: fix disconnect if audio not connected
### Added
- example/le_mitm: MITM implementation that forwards ATT PDUs and allows for pairing

View File

@ -312,13 +312,8 @@ void hsp_hs_disconnect(void){
return;
}
if (hsp_state < HSP_W4_SCO_CONNECTED){
hsp_state = HSP_W2_DISCONNECT_RFCOMM;
return;
}
hsp_disconnect_rfcomm = 1;
hsp_run();
hsp_establish_audio_connection = 0;
rfcomm_disconnect(rfcomm_cid);
}
@ -409,13 +404,6 @@ static void hsp_run(void){
return;
}
if (hsp_disconnect_rfcomm){
hsp_disconnect_rfcomm = 0;
hsp_establish_audio_connection = 0;
rfcomm_disconnect(rfcomm_cid);
return;
}
if (hsp_establish_audio_connection){
if (!rfcomm_can_send_packet_now(rfcomm_cid)) {
rfcomm_request_can_send_now_event(rfcomm_cid);