Skip to content

bluetooth: backend-native: Handle multi AT commands in a buffer

Hui Wang requested to merge jason77wang/pulseaudio:xt99fix into master

When we connect Lenovo XT99 bt headset in the Ubuntu 22.04, this headset could only work in A2DP profile, couldn't work in HFP profile with a high chance.

This headset supports mSBC, after pulseaudio replies "+BCS:2" to headset, we expect to receive a "AT+BCS=2\r" from the headset, but with a high chance, it will receive 2 AT commands in a buffer like this "AT+CHLD=?\rAT+BCS=2\r", and we also observed other 2 AT commands in a buffer like this "AT+NREC=0\rAT+CGMI?\r".

Here we don't suppose there is only one AT command in a buffer, we will find each command by the delimiter "\r" and handle each command by sequence.

Signed-off-by: Hui Wang

Edited by Hui Wang

Merge request reports