-
Couldn't load subscription status.
- Fork 8.1k
Bluetooth: Improve hfp hf and ag #77694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: Improve hfp hf and ag #77694
Conversation
|
@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. |
5fd8a78 to
7920610
Compare
OK. I have removed it from PR. And created a new PR for it. |
7920610 to
992a49e
Compare
992a49e to
ddee4ed
Compare
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>
8c313d5 to
1ecaf00
Compare
|
Rebase the changes to fix conflict issue. |
Improve the missing features of HFP HF and AG.
Including following features,