Skip to content

Commit 4833f82

Browse files
lylezhu2012kartben
authored andcommitted
Bluetooth: HFP_HF: Verify ability to reject a call
Check the ability of AG to reject a call. If the AG cannot reject the call, return error `-ENOTSUP`. Signed-off-by: Lyle Zhu <[email protected]>
1 parent 507c2e7 commit 4833f82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/bluetooth/host/classic/hfp_hf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,11 @@ int bt_hfp_hf_reject(struct bt_hfp_hf_call *call)
28452845
return -EINVAL;
28462846
}
28472847

2848+
if (!(hf->ag_features & BT_HFP_AG_FEATURE_REJECT_CALL)) {
2849+
LOG_ERR("AG has not ability to reject call");
2850+
return -ENOTSUP;
2851+
}
2852+
28482853
if (atomic_get(call->state) == BT_HFP_HF_CALL_STATE_WAITING) {
28492854
err = hfp_hf_send_cmd(hf, NULL, chup_finish, "AT+CHUP");
28502855
if (err < 0) {

0 commit comments

Comments
 (0)