hsp_ag: fix outgoing sdp query

This commit is contained in:
Matthias Ringwald 2016-04-09 20:35:15 +02:00
parent 1c2a5bcac3
commit ad1322ab5f

View File

@ -378,29 +378,33 @@ void hsp_ag_stop_ringing(void){
}
static void hsp_run(void){
if (!rfcomm_can_send_packet_now(rfcomm_cid)) {
rfcomm_request_can_send_now_event(rfcomm_cid);
return;
}
int err;
if (ag_send_ok){
ag_send_ok = 0;
err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_OK);
if (err){
ag_send_ok = 1;
}
return;
}
if (rfcomm_cid) {
if (ag_send_error){
ag_send_error = 0;
err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_ERROR);
if (err) {
ag_send_error = 1;
if (!rfcomm_can_send_packet_now(rfcomm_cid)) {
rfcomm_request_can_send_now_event(rfcomm_cid);
return;
}
if (ag_send_ok){
ag_send_ok = 0;
err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_OK);
if (err){
ag_send_ok = 1;
}
return;
}
if (ag_send_error){
ag_send_error = 0;
err = hsp_ag_send_str_over_rfcomm(rfcomm_cid, HSP_AG_ERROR);
if (err) {
ag_send_error = 1;
}
return;
}
return;
}
if (hsp_establish_audio_connection){