Skip to content

Commit e2987db

Browse files
committed
Bluetooth: Classic: CLCC report NULL when finish.
bug: v/78002 Rootcause: The CLCC API does not report when it finishes, app cannot know whether the CLCC procedure has ended. Signed-off-by: liyuheng <[email protected]>
1 parent 9931065 commit e2987db

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/zephyr/bluetooth/classic/hfp_hf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ struct bt_hfp_hf_cb {
493493
* If this callback is provided it will be called whenever the
494494
* result code `+CLCC: <idx>,<dir>,<status>,<mode>,<mprty>[,<number>,<type>]`
495495
* is received from AG.
496-
* If the request is failed or no active calls, the callback will not be called.
496+
* If the request is finished (success or fail), the callback will be called with a null *call.
497497
* If the @ref bt_hfp_hf_current_call::number is NULL, the
498498
* @ref bt_hfp_hf_current_call::type shall be ignored.
499499
*

subsys/bluetooth/host/classic/hfp_hf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ static int clcc_finish(struct at_client *hf_at, enum at_result result,
504504
clear_call_without_clcc(hf);
505505
}
506506

507+
if (atomic_test_bit(hf->flags, BT_HFP_HF_FLAG_USR_CLCC_CMD) &&
508+
(bt_hf->query_call != NULL)) {
509+
bt_hf->query_call(hf, NULL);
510+
}
511+
507512
atomic_clear_bit(hf->flags, BT_HFP_HF_FLAG_USR_CLCC_CMD);
508513
atomic_clear_bit(hf->flags, BT_HFP_HF_FLAG_CLCC_PENDING);
509514

0 commit comments

Comments
 (0)