Bluetooth: HFP HF: Disconnect rfcomm on SLC error

If found error during service level connection disconnect rfcomm.

Change-Id: Ida425375975b8d60ab1024d07a8ffe7745ae0b54
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
This commit is contained in:
Sathish Narasimman 2017-01-27 12:05:17 +05:30 committed by Szymon Janc
commit ccecfaac6a

View file

@ -50,7 +50,14 @@ static const struct {
void hf_slc_error(struct at_client *hf_at)
{
struct bt_hfp_hf *hf = CONTAINER_OF(hf_at, struct bt_hfp_hf, at);
int err;
BT_ERR("SLC error: disconnecting");
err = bt_rfcomm_dlc_disconnect(&hf->rfcomm_dlc);
if (err) {
BT_ERR("Rfcomm: Unable to disconnect :%d", -err);
}
}
int hfp_hf_send_cmd(struct bt_hfp_hf *hf, at_resp_cb_t resp,