Add configuration `CONFIG_BT_HFP_HF_VOICE_RECG` to enable Voice
recognition activation feature.
Add configuration `CONFIG_BT_HFP_HF_ENH_VOICE_RECG` to enable Enhanced
Voice Recognition Status feature.
Add configuration `CONFIG_BT_HFP_HF_VOICE_RECG_TEXT` to enable Voice
Recognition Text feature.
Add function `bt_hfp_hf_voice_recognition` to activate/deactivate the
Voice recognition activation feature.
Add function `bt_hfp_hf_ready_to_accept_audio` to indicate that the HF
is ready to accept audio.
Add a callback `voice_recognition` to notify the upper layer the
status of voice recognition activation.
Add a callback `vre_state` to notify the upper layer the state of
voice recognition engine.
Add a callback `textual_representation` to notify the upper layer the
textual representation.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The TX buf will be removed from TX queue after the data has been sent.
It causes the following TX buffers to be lost.
Fix it by removing TX buffer when sending it.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
There is an issue that the sending of AT+command will overwrite the at
status when the at is handling receiving.
Add a flag `BT_HFP_HF_FLAG_RX_ONGOING` to flag the receiving is
working.
When the flag is set, suspend the TX sending.
Add a worker to restart the tx sending.
After the flag `BT_HFP_HF_FLAG_RX_ONGOING` is cleared, submit the TX
worker to restart the tx sending.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration `BT_HFP_HF_3WAY_CALL` to control the feature.
Add a configuration `BT_HFP_HF_MAX_CALLS` to define supported maximum
calls.
Add a configuration `BT_HFP_HF_ECS` to configure the Enhanced Call
Status feature.
Add a configuration `BT_HFP_HF_ECC` to configure the Enhanced Call
Control feature.
Add a structure `struct bt_hfp_hf_call` to manage the call.
Add the call object to callback `outgoing`, and`incoming`.
Use call object to replace AG object for callbacks `remote_ringing`,
`on_hold`, `accept`, `reject`, `terminate`, `call_held`,
`ring_indication`, and `clip`.
Change callback `call_held` to `held`.
Add callback `retrieve` for the retrieved held call.
Add callback `call_waiting` to notify the application a new call is
waiting.
Use call object to replace AG object for function `bt_hfp_hf_accept`,
`bt_hfp_hf_reject`, `bt_hfp_hf_terminate`, and
`bt_hfp_hf_hold_incoming`.
Add functions for 3-way feature, including
`bt_hfp_hf_call_waiting_notify`, `bt_hfp_hf_release_all_held`,
`bt_hfp_hf_set_udub`, `bt_hfp_hf_release_active_accept_other`,
`bt_hfp_hf_hold_active_accept_other`, `bt_hfp_hf_join_conversation`,
`bt_hfp_hf_explicit_call_transfer`, `bt_hfp_hf_release_specified_call`,
and `bt_hfp_hf_private_consultation_mode`.
Add a new function `at_get_raw_string` to get the raw string from AT
response.
Move definitions of AT+CLCC value from hfp_ag_internal.h to
hfp_internal.h.
Monitor unsolicited result code `+CCWA`.
Enable `Call Waiting Notification` if the feature is supported by both
side when the SLC connected.
Get CHLD values supported by AG if the 3-way calling feature is
supported by both side.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Move CLCC status definitions from hfp_ag_internal.h to hfp_internal.h.
And change name from HFP_AG_CLCC_STATUS_XXX to BT_HFP_CLCC_STATUS_XXX.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration `BT_HFP_AG_3WAY_CALL` to control the feature.
Add a configuration `BT_HFP_AG_MAX_CALLS` to define supported maximum
calls.
Add a structure `struct bt_hfp_ag_call` to manage the call.
Add the call object to callback `outgoing`, and`incoming`.
Use call object to replace AG object for callbacks `incoming_held`,
`ringing`, `accept`, `reject`, and `terminate`.
Add callback `held` to notify the call held status.
Use call object to replace AG object for function
`bt_hfp_ag_hold_incoming`, `bt_hfp_ag_reject`, `bt_hfp_ag_accept`,
`bt_hfp_ag_terminate`, `bt_hfp_ag_remote_ringing`,
`bt_hfp_ag_remote_reject`, `bt_hfp_ag_remote_accept`, and
`bt_hfp_ag_remote_terminate`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a flag `BT_HFP_AG_CCWA_ENABLE` to keep the status of `Call Waiting
Notification`.
Set/clear the flag according to the value of received command AT+CCWA.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a flag `BT_HFP_AG_INCOMING_HELD` to identify the incoming call is
held.
Add a function `bt_hfp_ag_hold_incoming` to put the incoming call on
hold.
Add a callback `incoming_held` to notify the application the incoming
is held.
Handle AT command `AT+BTRH=x` to hold/accept/reject the incoming call.
Improve function `bt_hfp_hf_accept` to accept the held incoming call.
Improve function `bt_hfp_hf_reject` to reject the held incoming call.
Improve function `bt_hfp_hf_terminate` to terminate the held incoming
call.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a flag `BT_HFP_HF_FLAG_INCOMING_HELD` to identify the incoming call
is held.
Add a function `bt_hfp_hf_hold_incoming` to put the incoming call on
hold.
Handle the response `+BTRH` to get the incoming call status.
Add a callback `incoming_held` to notify the application the incoming
is held.
Remove callback `call_setup`. Add callback `outgoing` for call_setup=1,
`incoming` for call_setup=2, and `remote_ringing` for call_setup=3.
Remove callback `call`. Add callback `accept`, `reject`, `terminate`,
and `incoming_held`.
`accept` is triggered if the call is active.
`reject` is triggered if the incoming/
outgoing is not accepted but call is terminated.
`terminate` is triggered if the accepted is terminated.
`incoming_held` is triggered if the incoming call is held.
Improve function `bt_hfp_hf_accept` to accept the held incoming call.
Improve function `bt_hfp_hf_reject` to reject the held incoming call.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration `CONFIG_BT_HFP_HF_ECNR` to enable "EC and/or NR
function" of HFP HF.
Add a function `bt_hfp_hf_turn_off_ecnr` to turn off AG's EC and NR.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration to support "EC and/or NR function" of HFP AG.
Add a callback `ecnr_turn_off` to notify the application that "EC and/
or NR function" has been turned off.
Handle AT command AT+NREC=0. Only if the feature enabled, and the
callback `ecnr_turn_off` provided, the result code `OK` will be
responded.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_redial` to initiate outgoing voice calls by
recalling the last number dialed by the AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_memory_dial` to initiate outgoing voice
calls using the memory dialing feature of the AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_number_call` to initiate outgoing voice calls
by providing the destination phone number to the AG.
Add a callback `dialing` to notify the application the result from AG.
Add a flag `BT_HFP_HF_FLAG_DIALING` to make sure there is only one
dialing call at the same time.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add phone number dialing callback if the ATDNnnn AT command is
received from HFP HF.
If the callback is NULL, the ATDNnnn AT command cannot be
supported by the HFP AG.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_terminate` to terminate the active call.
Add a flag BT_HFP_HF_FLAG_ACTIVE to identify the call is active. Set
the flag if the call value is 1.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_reject` to reject the incoming call.
Add a flag BT_HFP_HF_FLAG_INCOMING to identify the incoming call.
Set the flag if the call_setup value is 1.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add the configuration `BT_HFP_HF_CODEC_NEG` to configure the codec
negotiation feature.
Add a configuration `BT_HFP_HF_CODEC_MSBC` to support mSBC codec.
Add a configuration `BT_HFP_HF_CODEC_LC3_SWB` to support LC3 SWB codec.
Add a function `bt_hfp_hf_audio_connect` to trigger audio connection
sequence.
Add a function `bt_hfp_hf_select_codec` to response the codec
negotiation request.
Add a function `bt_hfp_hf_set_codecs` to notify the AG supported Codec
IDs of HF.
Handle unsolicited response `+BCS` sent from AG.
Send supported Codec IDs supported by HF if the SLC is established.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration BT_HFP_AG_CODEC_NEG to configure the feature.
Add a function bt_hfp_ag_audio_connect to setup the codec negotiation
procedure.
Improve AT+BAC and AT+BCC handle.
Add callback codec_negotiate to notify the application of codec
negotiation result.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a configuration BT_HFP_AG_EXT_ERR for this feature.
If the feature is not set, response the ERROR to the peer if the AT
command AT+CMEE received.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a dedicated SDP features definition.
Set feature "Three-way calling" by default both in SDP features
definition and AT command features definition. Because it is set
by default in Spec.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_accept` to accept the incoming call.
Add a flag BT_HFP_HF_FLAG_INCOMING to identify the incoming call.
Set the flag if the call_setup value is 1.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Expose a function to set the network operator and mode.
Response the AT+COPS? command with set mode and operator.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add function `bt_hfp_hf_get_operator` to read the currently network
operator of AG.
Add callback `operator` to notify the application of the response.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Send AT command AT+VGM and AT+VGS after SLC established.
The `VGM` and `VGS` can be set by calling function `bt_hfp_hf_vgs` and
`bt_hfp_hf_vgs` in HF connection callback.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add AT command sending structure to queue all AT commander needed to
be sent after the SLC established.
After the SLC established, send AT command line one by one.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Support separator "=".
If the separator is "=", only when result code is VGS" or "VGM", the
result code is valid.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Handle the unsolicited result code +BSIR issued by the AG to indicate
to the HF that the in-band ring tone setting has been locally changed.
Add a callback `inband_ring` to notify the in-band ring tone setting.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
All set flags are cleared when call is terminated. But for case that
SLC is not disconnected, only call related flags should be cleared.
Just clear call related flags if the call is terminated.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The AT command `AT+CLIP=1` or `AT+CLIP=0` cannot be parsed correctly.
Check `=` before get AT command value.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add function bt_hfp_hf_vgm to configure Gain of Microphone.
Add function bt_hfp_hf_vgs to configure Gain of Speaker.
These functions are controlled by configuration
`CONFIG_BT_HFP_HF_VOLUME`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Handle the unsolicited result code +VGS and +VGM if the configuration
`CONFIG_BT_HFP_HF_VOLUME` is enabled.
Add a callback `vgm` to notify the application speaker microphone
notification if the configuration `CONFIG_BT_HFP_HF_VOLUME` is enabled.
Add a callback `vgs` to notify the application speaker gain
notification if the configuration `CONFIG_BT_HFP_HF_VOLUME` is enabled.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add tx pending queue to queue call AT commands.
Add a function bt_hfp_hf_cli to enable/disable CLI notification.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Handle the unsolicited result code +CLIP.
Add a callback `clip` to notify the application if the configuration
`CONFIG_BT_HFP_HF_CLI` is enabled.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add Kconfig to configure the HF `CLI` and `VOLUME` features.
Add a macro `BT_HFP_HF_SDP_SUPPORTED_FEATURES` for SDP HF record.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Use the builtin intn macros for 20.1+, as 20.0 doesn't include them.
20.0 wasn't an official release.
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Add the ability to set the MAC address from the command line when
running a native sim build.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
Added mikrobus_i2c, mikrobus_spi and mikrobus_serial node labels
to device tree board definition, allowing compatible shield boards
to be used. Also added User Button 2 definition and refactored
pinctrl defintions into separate file.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
Updates common locking mechanism used in internal HAL calls,
mainly targetting Wi-Fi/BLE and REGI2C calls. This improves/fixes
scenarios of nested critical sections calls.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>