Skip to content

Commit de7546b

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 eb4971c commit de7546b

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
@@ -494,7 +494,7 @@ struct bt_hfp_hf_cb {
494494
* If this callback is provided it will be called whenever the
495495
* result code `+CLCC: <idx>,<dir>,<status>,<mode>,<mprty>[,<number>,<type>]`
496496
* is received from AG.
497-
* If the request is failed or no active calls, the callback will not be called.
497+
* If the request is finished (success or fail), the callback will be called with a null *call.
498498
* If the @ref bt_hfp_hf_current_call::number is NULL, the
499499
* @ref bt_hfp_hf_current_call::type shall be ignored.
500500
*

subsys/bluetooth/host/classic/hfp_hf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ static int clcc_finish(struct at_client *hf_at, enum bt_at_result result,
524524
clear_call_without_clcc(hf);
525525
}
526526

527+
if (atomic_test_bit(hf->flags, BT_HFP_HF_FLAG_USR_CLCC_CMD) &&
528+
(bt_hf->query_call != NULL)) {
529+
bt_hf->query_call(hf, NULL);
530+
}
531+
527532
atomic_clear_bit(hf->flags, BT_HFP_HF_FLAG_USR_CLCC_CMD);
528533
atomic_clear_bit(hf->flags, BT_HFP_HF_FLAG_CLCC_PENDING);
529534

0 commit comments

Comments
 (0)