Skip to content

Conversation

@lylezhu2012
Copy link
Contributor

Improve the missing features of HFP HF and AG.
Including following features,

  • Phone status information
  • Audio Connection handling
  • Audio Connection transfer during an ongoing call
  • Place a call with the phone number supplied by the HF
  • Place a call using memory dialing
  • Place a call to the last number dialed
  • Call waiting notification
  • Three-way calling
  • Calling Line Identification (CLI)
  • Echo canceling (EC) and noise reduction (NR)
  • Voice recognition activation
  • Attach a Phone number for a voice tag
  • Ability to transmit DTMF codes
  • Remote audio volume control
  • Respond and Hold
  • Subscriber Number Information
  • Enhanced Call Status
  • Enhanced Call Controls
  • Individual Indicator Activation
  • Codec Negotiation
  • HF Indicators

@jhedberg
Copy link
Member

@lylezhu2012 thanks for the PR, however 68 commits and 11k lines added is going to take a lot of time to review properly. Any chance you could split this up into smaller logical chunks? Some commits don't seem to be at all related to HFP, like Driver: hci_nxp_setup: Change log message to LOG_DBG - those should at least be in separate PRs.

@hermabe hermabe removed their request for review August 28, 2024 11:49
@decsny decsny removed their request for review August 28, 2024 16:35
@lylezhu2012 lylezhu2012 force-pushed the improve_hfp_hf_and_ag branch from 5fd8a78 to 7920610 Compare August 29, 2024 03:14
@lylezhu2012
Copy link
Contributor Author

@lylezhu2012 thanks for the PR, however 68 commits and 11k lines added is going to take a lot of time to review properly. Any chance you could split this up into smaller logical chunks? Some commits don't seem to be at all related to HFP, like Driver: hci_nxp_setup: Change log message to LOG_DBG - those should at least be in separate PRs.

OK. I have removed it from PR. And created a new PR for it.

@lylezhu2012 lylezhu2012 force-pushed the improve_hfp_hf_and_ag branch from 7920610 to 992a49e Compare August 29, 2024 07:48
@lylezhu2012 lylezhu2012 removed the platform: NXP Drivers NXP Semiconductors, drivers label Aug 29, 2024
@Thalley Thalley removed their request for review August 29, 2024 08:10
@lylezhu2012 lylezhu2012 force-pushed the improve_hfp_hf_and_ag branch from 992a49e to ddee4ed Compare August 29, 2024 10:03
Add a function `bt_hfp_hf_indicator_status` to activate/deactivate AG
indicators.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Improve the process of AT command `AT+BIA` to mask the activated/
deactivated indicators.

Only notify the activated indicator if the value of it is updated.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current implementation, it is difficult to insert new AT commands
in the SLC initialization sequence.

Add a SLC initialization sequence. Send AT command one by one.

It will be easy to insert new AT commands in the appropriate position.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add configuration `CONFIG_BT_HFP_HF_HF_INDICATORS` to enable feature
HF Indicators.

Add configuration `CONFIG_BT_HFP_HF_HF_INDICATOR_ENH_SAFETY` to
support HF indicator `Enhanced Safety`.

Add configuration `CONFIG_BT_HFP_HF_HF_INDICATOR_BATTERY` to support
HF indicator `Remaining level of Battery`.

Add function `bt_hfp_hf_enhanced_safety` to transfer enhanced safety
status.

Add function `bt_hfp_hf_battery` to transfer Remaining level of
Battery.

Send AT command to notify AG the supported HF indicators of HF in SLC
initialization sequence.

Send AT command to get the supported HF indicators of AG in SLC
initialization sequence.

Send AT command to get the enabled/disabled state of generic status
indicators from AG in SLC initialization sequence.

Handle unsolicited result code `+BIND`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add configuration `CONFIG_BT_HFP_AG_HF_INDICATORS` to enable feature
HF Indicators.

Add configuration `CONFIG_BT_HFP_AG_HF_INDICATOR_ENH_SAFETY` to
support HF indicator `Enhanced Safety`.

Add configuration `CONFIG_BT_HFP_AG_HF_INDICATOR_BATTERY` to support
HF indicator `Remaining level of Battery`.

Add function `bt_hfp_ag_hf_indicator` to activate/deactivate HF
indicator.

Optimize the handle of AT command `AT+BIND`.

Handle AT command `AT+BIEV`.

Add callback `hf_indicator_value` to notify the value of HF indicator.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Change `HF_SINGNAL_IND` to `HF_SIGNAL_IND`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Change `Dailing` to `Dialing`.
Change `HFP unit` to `HF`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add function `bt_hfp_hf_connect` to initialize the Service Level
Connection establishment procedure.

Add function `bt_hfp_hf_disconnect` to release the Service Level
Connection.

Clear HF object if the RFCOMM is disconnected.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration `CONFIG_BT_HFP_AG_REJECT_CALL` for feature
`Ability to reject a call`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Check the ability of AG to reject a call. If the AG cannot reject the
call, return error `-ENOTSUP`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Define SDP records for HFP AG. Register HFP AG SDP service records in
AG initialization.

Register HFP AG RFCOMM server in AG initialization.

Register HFP AG SCO server in AG initialization.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Find HF object according to conn object index directly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Support HFP HF and AG in shell.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a option `HFPHF` to find HFP HF SDP records from HFP AG side.

Add a SDP records discovery parameter `discov_hfphf` for this option.

Add a function `sdp_hfp_hf_user` to handle the discovery result.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the interface of AG is updated, update AG sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Divide hfp_internal.h into two parts, HFP HF part hfp_hf_internal.h and
HFP common part hfp_internal.h.

Includes "hfp_internal.h" in file "hfp_ag_internal.h".
Includes "hfp_ag_internal.h" in file "hfp_ag.c".

Includes "hfp_internal.h" in file "hfp_hf_internal.h".
Includes "hfp_hf_internal.h" in file "hfp_hf.c".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Due to the interface of HF is updated, update HF sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
There is an error reported in platform `native_sim` that the value of
`EOPNOTSUPP` is same as `ENOTSUP`.
It cause the building error `duplicate case value '-95'` reported.

Use `ENOEXEC` to replace `EOPNOTSUPP` to fix the building issue.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The lock/unlock for AG/HF feature read access is unnecessary.
For AG feature, it only be changed when creating new AG object.
For HF feature, it only be changed when exchanging feature in SLC
establishment.

Remove the hfp_ag_lock/hfp_ag_unlock for AG/HF feature read access.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add `BOTH_SUPT_FEAT(ag, _hf_feature, _ag_feature)` to check if the
feature is supported by both side.
Add `HF_SUPT_FEAT(ag, _feature)` to check if the feature is supported
by HF.
Add `AG_SUPT_FEAT(ag, _feature)` to check if the feature is supported
by AG.

Use `BOTH_SUPT_FEAT/HF_SUPT_FEAT/AG_SUPT_FEAT` to optimize code that
checks whether a feature is supported.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Remove all unnecessary code lines `__fallthrough` from switch-case.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the AG works as Data Channel Acceptor, the ACL conn cannot be known
by the application of AG. Similar with HF, add ACL conn as the first
parameter to the `connected` callback of AG.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
@lylezhu2012 lylezhu2012 force-pushed the improve_hfp_hf_and_ag branch from 8c313d5 to 1ecaf00 Compare March 21, 2025 06:15
@lylezhu2012
Copy link
Contributor Author

Rebase the changes to fix conflict issue.

@lylezhu2012 lylezhu2012 requested a review from gzh-terry April 2, 2025 12:13
@kartben kartben merged commit c09cf23 into zephyrproject-rtos:main Apr 3, 2025
23 checks passed
@kartben kartben removed the request for review from zhangyuan376 April 10, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Classic Bluetooth Classic (BR/EDR) area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth area: Samples Samples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants