From 1d34cc59b2c3a37b788f32a96240b34e901d6471 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 12 Nov 2015 23:19:55 +0100 Subject: [PATCH 1/2] update state before trying to send rfcomm message --- src/hsp_hs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hsp_hs.c b/src/hsp_hs.c index 9dae2dd8b..a6d3ae7f4 100644 --- a/src/hsp_hs.c +++ b/src/hsp_hs.c @@ -348,18 +348,26 @@ static void hsp_run(void){ if (hs_ok_received) break; if (hs_microphone_gain >= 0){ + int gain = hs_microphone_gain; + hs_microphone_gain = -1; char buffer[20]; sprintf(buffer, "%s=%d\r\n", HSP_HS_MICROPHONE_GAIN, hs_microphone_gain); err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); - if (!err) hs_microphone_gain = -1; + if (err) { + hs_microphone_gain = gain; + } break; } if (hs_speaker_gain >= 0){ + int gain = hs_speaker_gain; + hs_speaker_gain = -1; char buffer[20]; sprintf(buffer, "%s=%d\r\n", HSP_HS_SPEAKER_GAIN, hs_speaker_gain); err = hsp_hs_send_str_over_rfcomm(rfcomm_cid, buffer); - if (!err) hs_speaker_gain = -1; + if (err) { + hs_speaker_gain = gain; + } break; } From 7cb7a632d763874280dd9ff85816a95d247ae35a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 12 Nov 2015 23:29:54 +0100 Subject: [PATCH 2/2] fix compile for old folder structure --- test/pts/sco_loopback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pts/sco_loopback.c b/test/pts/sco_loopback.c index af3b09a36..ab554a07b 100644 --- a/test/pts/sco_loopback.c +++ b/test/pts/sco_loopback.c @@ -46,7 +46,7 @@ #include #include -#include "hci_cmds.h" +#include #include "hci.h" #include "debug.h"