Skip to content

Conversation

lylezhu2012
Copy link
Contributor

Due to the flag BT_HFP_HF_FLAG_CLCC_PENDING is set when receiving the +CIEV or +CIND notification, the command AT+CLCC will be pending due to the flag is not cleared.

Add a flag BT_HFP_HF_FLAG_INITIATING to indicate the HF initialization is ongoing.

Add a flag BT_HFP_HF_FLAG_QUERY_CALLS to indicate the current calls list needs to be queried.

Set the flag BT_HFP_HF_FLAG_INITIATING at the beginning of the HF initialization. Set the flag BT_HFP_HF_FLAG_QUERY_CALLS instead of setting the flag BT_HFP_HF_FLAG_CLCC_PENDING if the current calls list needs to be queried and the flag BT_HFP_HF_FLAG_INITIATING is set.

After the HF initialization is done, query list of the current calls by calling the function hf_query_current_calls() if the flag BT_HFP_HF_FLAG_QUERY_CALLS is set.

Set the flag BT_HFP_HF_FLAG_CLCC_PENDING if it is not set in the function hf_query_current_calls().

@gzh-terry
Copy link
Contributor

gzh-terry commented Sep 24, 2025

We actually need a interface for the upper layer to query current calls.
Note that Android (i.e., upper layer) needs to send AT+CLCC from its headsetClientStateMachine and is waiting for responses (include the "OK").

It seems like most of the APIs keeps at stack level (similar as Android BTIF/BTA). But for call informations, they become high level APIs (similar as Android AIDL). Indeed it works, but would be a little be hard to migrate to (co-work with) other system.

@lylezhu2012
Copy link
Contributor Author

We actually need a interface for the upper layer to query current calls. Note that Android (i.e., upper layer) needs to send AT+CLCC from its headsetClientStateMachine and is waiting for responses (include the "OK").

It seems like most of the APIs keeps at stack level (similar as Android BTIF/BTA). But for call informations, they become high level APIs (similar as Android AIDL). Indeed it works, but would be a little be hard to migrate to (co-work with) other system.

Yes. I think we can improve it later.

@lylezhu2012
Copy link
Contributor Author

Yes. I think we can improve it later.

It is created here #96564

makeshi
makeshi previously approved these changes Sep 29, 2025
Due to the flag `BT_HFP_HF_FLAG_CLCC_PENDING` is set when receiving
the +CIEV or +CIND notification, the command `AT+CLCC` will be
pending due to the flag is not cleared.

Add a flag `BT_HFP_HF_FLAG_INITIATING` to indicate the HF
initialization is ongoing.

Add a flag `BT_HFP_HF_FLAG_QUERY_CALLS` to indicate the current calls
list needs to be queried.

Set the flag `BT_HFP_HF_FLAG_INITIATING` at the beginning of the HF
initialization. Set the flag `BT_HFP_HF_FLAG_QUERY_CALLS` instead of
setting the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if the current calls
list needs to be queried and the flag `BT_HFP_HF_FLAG_INITIATING` is
set.

After the HF initialization is done, query list of the current calls
by calling the function `hf_query_current_calls()` if the flag
`BT_HFP_HF_FLAG_QUERY_CALLS` is set.

Set the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if it is not set in the
function `hf_query_current_calls()`.

Signed-off-by: Lyle Zhu <[email protected]>
@lylezhu2012 lylezhu2012 force-pushed the classic_hfp_fix_at_clcc_can_not_be_sent_issue branch from 9c6d618 to e172a06 Compare October 9, 2025 06:59
@lylezhu2012 lylezhu2012 requested a review from makeshi October 9, 2025 07:00
@zephyrbot zephyrbot requested a review from chengkai15 October 9, 2025 07:01
Copy link

sonarqubecloud bot commented Oct 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants