In case headset fails to reply with AT+BCS to the codec selection
following AT+CMER, try to retry the codec selection, and if it still
fails, assume the headset is configured for CVSD.
There won't be further battery level updates when RFCOMM connection is
down, so remove the battery then.
Fix minor things with canceling the provider registration.
Auto-connect all paired & trusted devices on startup.
Since devices that already connected or powering off would reject the connecting requests, it should be fine with this behavior.
Also reconnect remaining profiles if only partial profiles are connected.
When I enforing HFP codec switching between HFP profiles, it has a chance of being aborted by ECONNABORTED. Seems a retry is sufficient for work around it.
Implement switching HFP codecs in bluez5-devices, currently only for
backend-native.
Codecs are exposed via profiles similarly as for A2DP.
Some hardware appears to not properly reply to the +BCS message. Catch
these cases with a timeout, in which case we fall back to previously
existing transports.
Incoming connections only happen when the remote end is an AG.
Advertising the state allows the device to dynamically create nodes
for such connections.
This does not work as intended, because we no longer do a codec switch
on device connect. It should be done in a different way, but since it's
not used for anything right now, can as well remove it.
This will prevent to run the different backends concurrently.
The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
In BT_DEFER_SETUP mode, when a connection is accepted, the listening
socket is unblocked but the effective connection setup happens only on
first receive, allowing to configure the accepted socket.
First read from the accepted socket is non-blocking and returns a zero
length buffer.
This waits for codec negotiation completion, i.e. on `SLC` completion if
codec negotiation is not supported or on `AT+BCS` reception if codec
negotiation is supported, before creating the `spa_bt_transport`