mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
bluetooth: Fix some native backend command sending
We weren't writing out one character from the "OK" response, and the "AT" part of the "+VGS" and "+VGM" commands was missing. Also, the spec says that the command is terminated by only a CR and not an LF (probably doesn't hurt, but let's adhere to the spec for now).
This commit is contained in:
parent
34a5c754a9
commit
5dfa83385c
1 changed files with 5 additions and 5 deletions
|
|
@ -248,7 +248,7 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
|
||||||
|
|
||||||
pa_log_debug("RFCOMM >> OK");
|
pa_log_debug("RFCOMM >> OK");
|
||||||
|
|
||||||
len = write(fd, "\r\nOK\r\n", 5);
|
len = write(fd, "\r\nOK\r\n", 6);
|
||||||
|
|
||||||
/* we ignore any errors, it's not critical and real errors should
|
/* we ignore any errors, it's not critical and real errors should
|
||||||
* be caught with the HANGUP and ERROR events handled above */
|
* be caught with the HANGUP and ERROR events handled above */
|
||||||
|
|
@ -285,8 +285,8 @@ static void set_speaker_gain(pa_bluetooth_transport *t, uint16_t gain) {
|
||||||
|
|
||||||
t->speaker_gain = gain;
|
t->speaker_gain = gain;
|
||||||
|
|
||||||
len = sprintf(buf, "+VGS=%d\r\n", gain);
|
len = sprintf(buf, "AT+VGS=%d\r", gain);
|
||||||
pa_log_debug("RFCOMM >> +VGS=%d", gain);
|
pa_log_debug("RFCOMM >> AT+VGS=%d", gain);
|
||||||
|
|
||||||
written = write(trfc->rfcomm_fd, buf, len);
|
written = write(trfc->rfcomm_fd, buf, len);
|
||||||
|
|
||||||
|
|
@ -304,8 +304,8 @@ static void set_microphone_gain(pa_bluetooth_transport *t, uint16_t gain) {
|
||||||
|
|
||||||
t->microphone_gain = gain;
|
t->microphone_gain = gain;
|
||||||
|
|
||||||
len = sprintf(buf, "+VGM=%d\r\n", gain);
|
len = sprintf(buf, "AT+VGM=%d\r", gain);
|
||||||
pa_log_debug("RFCOMM >> +VGM=%d", gain);
|
pa_log_debug("RFCOMM >> AT+VGM=%d", gain);
|
||||||
|
|
||||||
written = write (trfc->rfcomm_fd, buf, len);
|
written = write (trfc->rfcomm_fd, buf, len);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue