Bluetooth: HFP_AG: Ability to reject call
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>
This commit is contained in:
parent
d7cdadc4be
commit
507c2e7fc0
3 changed files with 21 additions and 1 deletions
|
@ -413,6 +413,12 @@ config BT_HFP_AG_HF_INDICATOR_BATTERY
|
|||
help
|
||||
This option enables HF Indicator Battery level for HFP AG
|
||||
|
||||
config BT_HFP_AG_REJECT_CALL
|
||||
bool "Ability to reject a call for HFP AG [EXPERIMENTAL]"
|
||||
default y
|
||||
help
|
||||
This option enables ability to reject a call for HFP AG
|
||||
|
||||
endif # BT_HFP_AG
|
||||
|
||||
config BT_AVDTP
|
||||
|
|
|
@ -3817,6 +3817,7 @@ int bt_hfp_ag_reject(struct bt_hfp_ag_call *call)
|
|||
int err = 0;
|
||||
struct bt_hfp_ag *ag;
|
||||
bt_hfp_call_state_t call_state;
|
||||
uint32_t ag_features;
|
||||
|
||||
LOG_DBG("");
|
||||
|
||||
|
@ -3837,12 +3838,18 @@ int bt_hfp_ag_reject(struct bt_hfp_ag_call *call)
|
|||
}
|
||||
|
||||
call_state = call->call_state;
|
||||
ag_features = ag->ag_features;
|
||||
hfp_ag_unlock(ag);
|
||||
|
||||
if (!atomic_test_bit(call->flags, BT_HFP_AG_CALL_INCOMING)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(ag_features & BT_HFP_AG_FEATURE_REJECT_CALL)) {
|
||||
LOG_ERR("AG has not ability to reject call");
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
if (atomic_test_bit(call->flags, BT_HFP_AG_CALL_INCOMING_3WAY)) {
|
||||
if ((call_state == BT_HFP_CALL_ALERTING) || (call_state == BT_HFP_CALL_INCOMING)) {
|
||||
uint8_t call_setup;
|
||||
|
|
|
@ -98,6 +98,12 @@
|
|||
#define BT_HFP_AG_FEATURE_HF_IND_ENABLE 0
|
||||
#endif /* CONFIG_BT_HFP_HF_HF_INDICATORS */
|
||||
|
||||
#if defined(CONFIG_BT_HFP_AG_REJECT_CALL)
|
||||
#define BT_HFP_AG_FEATURE_REJECT_CALL_ENABLE BT_HFP_AG_FEATURE_REJECT_CALL
|
||||
#else
|
||||
#define BT_HFP_AG_FEATURE_REJECT_CALL_ENABLE 0
|
||||
#endif /* CONFIG_BT_HFP_AG_REJECT_CALL */
|
||||
|
||||
/* HFP AG Supported features */
|
||||
#define BT_HFP_AG_SUPPORTED_FEATURES (\
|
||||
BT_HFP_AG_FEATURE_3WAY_CALL_ENABLE | \
|
||||
|
@ -111,7 +117,8 @@
|
|||
BT_HFP_AG_FEATURE_ENH_VOICE_RECG_ENABLE | \
|
||||
BT_HFP_AG_FEATURE_VOICE_RECG_TEXT_ENABLE | \
|
||||
BT_HFP_AG_FEATURE_VOICE_TAG_ENABLE | \
|
||||
BT_HFP_AG_FEATURE_HF_IND_ENABLE)
|
||||
BT_HFP_AG_FEATURE_HF_IND_ENABLE | \
|
||||
BT_HFP_AG_FEATURE_REJECT_CALL_ENABLE)
|
||||
|
||||
/* HFP AG Supported features in SDP */
|
||||
#define BT_HFP_AG_SDP_SUPPORTED_FEATURES (\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue