Add support for processing the Fault Status Registers and recoverable
data abort for the cortex A7.
Based on Cortex-A7 MPCore Technical Reference Manual (ARM DDI 0406).
(see https://developer.arm.com/documentation/ddi0406)
Signed-off-by: Julien Racki <julien.racki@st.com>
We can't use the timer.h as the arm timer
is within the soc and does not have an address.
Instead we use the armv8_timer.h, renaming it to armv7_v8_timer.h
for the Cortex-A7 as the cp15 access are compatible.
Signed-off-by: Julien Racki <julien.racki@st.com>
`extern "C"` is not a valid language linkage for declaring
`int main(...)`, as per the ISO C++ Standard Specification.
This fixes the violations of -Wmain, and brings Zephyr
closer to valid C++.
See the C++ standard wording here:
https://eel.is/c++draft/basic.start.main#3.sentence-5
See also the clang warning -Wmain:
https://clang.llvm.org/docs/DiagnosticsReference.html#wmain
However, for freestanding code (i.e. with -ffreestanding),
main has no special meaning, and we need to prevent name
mangling. So allow this forward linkage when not hosted.
This only applies to C++ as these linkage declarations only
exist inside __cplusplus guards.
Signed-off-by: Jordan R Abrahams-Whitehead <ajordanr@google.com>
When building with clang it reports:
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:69:22: error: variable
'test_response_read_data_start' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_start[5] = {
^
tests/subsys/mgmt/mcumgr/settings_mgmt/src/main.c:73:22: error: variable
'test_response_read_data_end' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t test_response_read_data_end[1] = {
^
The values of test_response_read_data_start and
test_response_read_data_end are not actually used anywhere in the tests.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
The error occur when discoverying br devices and need to send request_name
for many found devices.
In system work queue task, bt_hci_inquiry_complete->
report_discovery_results is called, then request_name is called for all
the found devices. The controller gives HCI_Remote_Name_Request_Complete
event for every name request result and one buf is allocated from
hci_rx_pool to save HCI_Remote_Name_Request_Complete. When system work
queue task is blocked to call request_name for every device, many
HCI_Remote_Name_Request_Complete are received for the already sent
request_name, it uses up all the buf of hci_rx_pool, then the bt_rx_thread
task is blocked to get buf from hci_rx_pool when next
HCI_Remote_Name_Request_Complete is received, meanwhile the next
request_name send hci cmd and wait the result, but the hci status/complete
event can't be received because the bt_rx_thread is blocked and
bt_uart_isr is kept in the state to receive last
HCI_Remote_Name_Request_Complete, then bt_dev.ncmd_sem is not released,
then the next request_name send hci cmd again, but the bt_dev.ncmd_sem is
invalid, then bt_hci_cmd_send_sync fail and assert.
resolve it by requesting name one by one.
Signed-off-by: Mark Wang <yichang.wang@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>
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 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>
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>
Handle AT command `AT+CNUM`.
Add a callback function `subscriber_number` to notify the upper layer
that the HF needs to get subscriber number information from the AG.
If there is subscriber number information needs to be sent, the passed
function `bt_hfp_ag_query_subscriber_func_t func` can be called for
this purpose.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add function `bt_hfp_hf_query_subscriber` to query the AG subscriber
number.
Add callback `subscriber_number` to notify the result of the query of
the subscriber number information.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Handle AT command `AT+VTS`.
Add a callback `transmit_dtmf_code`. When a valid AT command `AT+VTS`
is received, call the callback to notify the upper layer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add configuration `CONFIG_BT_HFP_AG_VOICE_TAG` to enable the feature
`attach a phone number for a voice tag`.
Handle AT command `AT+BINP=1`.
Add callback `request_phone_number` to notify the request and get the
phone number from the upper layer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a function `bt_hfp_hf_request_phone_number` to request phone number
to the AG.
Add a callback `request_phone_number` to notify the result of the
request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add configuration `CONFIG_BT_HFP_AG_VOICE_RECG` to enable Voice
recognition activation feature.
Add configuration `CONFIG_BT_HFP_AG_ENH_VOICE_RECG` to enable Enhanced
Voice Recognition Status feature.
Add configuration `CONFIG_BT_HFP_AG_VOICE_RECG_TEXT` to enable Voice
Recognition Text feature.
Add function `bt_hfp_ag_voice_recognition` activate/deactivate the
Voice recognition activation feature.
Add function `bt_hfp_ag_vre_state` to notify the state of the voice
recognition engine.
Add function `bt_hfp_ag_vre_textual_representation` to notify the
state and textual representation of voice recognition engine.
Add callback `voice_recognition` to notify the upper layer the status
of voice recognition activation.
Add callback `ready_to_accept_audio` to notify the upper layer that
the HF is ready to accept audio.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
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>
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>
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_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 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>