bluetooth: add correct HFP rfcomm negotiation

HFP 1.6 requires a stateful negotiation of AT commands.  The prior
version got away with initialising HFP simply by replying 'OK' to
every negotiation attempt.  This one actually tries to parse the state
and make sure the negotiation occurs correctly

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

---

v4:

- Update for PA 11.0
- Finally sort out CIND negotiaton for complex headsets

v3:

- remove internal debugging
- added comment for t->config being not null for hfp
- removed unused returns from hfp_rfcomm_handle()
- remove rfcomm comment
- use pa_startswith
- simplify negotiation

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/491>
This commit is contained in:
James Bottomley 2016-08-20 10:56:14 -07:00 committed by Igor Kovalenko
parent 66ed99a13d
commit 485a64642e
3 changed files with 125 additions and 6 deletions

View file

@ -172,7 +172,10 @@ pa_bluetooth_transport *pa_bluetooth_transport_new(pa_bluetooth_device *d, const
if (size > 0) {
t->config = pa_xnew(uint8_t, size);
memcpy(t->config, config, size);
if (config)
memcpy(t->config, config, size);
else
memset(t->config, 0, size);
}
return t;