There is a corner case found that the ACL connected event may be
printed when script is sending shell command by calling function
`shell.exec_command()`. The echo of shell command will mix with the
ACL connected event message. The received message cannot be
recognized by the function `shell.exec_command()`. It caused the
timeout exception reported by the function `shell.exec_command()`.
Before sending any shell commands, check the DUT connected event
after the connection is established on script side.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Input and output descriptors are writable storage for VCP parameters
and shall be valid for use duration. This fix usage of variables being
used outside of their declaration scope.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Introduce development and fatal assertion classification
in the Controller implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Updates the bt shell API to use the new Kconfig option
BT_APP_PASSKEY instead of BT_FIXED_PASSKEY as this is being
deprecated.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
- We want to reuse ext_advs when first stopped and restarted
- This ensures SID is the same
- Fixes CAP/CL/ADV/BV-03-C
Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
Remove previous Kconfig choices CONFIG_BT_MESH_USES_MBEDTLS_PSA and
CONFIG_BT_MESH_USES_TFM_PSA and use CONFIG_PSA_CRYPTO instead.
This commit also updates test code accordingly.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Remove deprecated Kconfig option usage, and replace it with corresponding
options which yield the same behavior as before.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Those are not applied properly as subsequent overlays may (and
actually do!) overwrite some of configurations tuned in here.
Also with latest improvements in userchannel HCI driver low
buffers are handled in similar way as on real boards so no extra
tuning is needed anyway.
This reverts commit b6e7b650a2.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add new command to set scanning parameters, including scan window,
scan interval, and physical interface (1M and coded PHYs).
Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
Added three functions to support the EAD peripheral:
- Setting and storing key materials for EAD
- Encrypting data for EAD advertisements
- Decrypting data from EAD advertisements
Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A handful of Bluetooth controller tests were using %d for
non-int values. Some of the values were either uint64_t or
long unsigned ints.
In most cases, the types could be modified to uint8_t and
the formats changed to use %u.
In some macros, the types were just cast, as the values
would never be larger than uint8_t. The values in this case
were defined as e.g. BIT(0), BIT(1) and BIT(2) (which use the
UL type in the macro).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the unit tests to use the native_sim board instead of the
unit_testing board.
The native_sim board allows us to use the kernel in a more
regular way, while still being able to treat the tests as
unittest.
This commit also removes unused includes in the CMakelists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
read_multi_var was always sending 5 as count of handles.
This was causing failure in GATT/CL/GAR/BI-36-C, GATT/CL/GAR/BI-40-C
and other tests expecting IUT to send
GATT_ReadMultipleVariableLengthRequest
Fixed this was using the cp->handles_count coming by autoPTS.
Signed-off-by: Ravinder Singh <ravinder.singh2@infineon.com>
Add a test case that disables asserts to ensure that the
BT shell with audio can be built without compiler
warnings/errors when asserts are disabled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update the CAP initiator audio start unittest.
The reason for this, is that the recent change to endpoints
means that we need to properly generate a BAP unicast group
and call bt_bap_stream_config, instead of trying to manage
the bap_iso values directly.
As part of updating this, the tests were also updated to
significantly reduce code duplication, but generating
a default start param that can easily be reused.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
copy may be uninitialzed in the default case, which causes some
compiler warnings/errors when returned and used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Rename the bt_bap_is_x_ep functions to better match the
modules where they are implemented.
Additionally modify the check to use IS_ARRAY_ELEMENT
in the broadcast sink and source for a stricter check.
IS_ARRAY_ELEMENT cannot easily be used in the unicast
client and server, as the endpoints are part of another
structure.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We check for all other roles when checking whether
an endpoint can send or receive, except for the unicast server.
It is technically implied, but if the ep is not a valid pointer,
then we may access invalid memory.
Add check for bt_bap_ep_is_unicast_server (which uses the new
bt_ascs_has_ep function).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This patch enables AVRCP-related configuration options in the shell
test project. These options are required to test AVRCP functionality
in Bluetooth Classic shell environment.
Signed-off-by: Make Shi <make.shi@nxp.com>
Add commands `BTP_SDP_SEARCH_REQ`, `BTP_SDP_ATTR_REQ`, and
`BTP_SDP_SEARCH_ATTR_REQ`.
Add service record handle report event
`BTP_SDP_EV_SERVICE_RECORD_HANDLE`.
Handle the commands and call function `bt_sdp_discover()` to start the
SDP discovery.
And report the discovered service record handle if the request type is
`BTP_SDP_SEARCH_REQ`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add service id BTP_SERVICE_ID_SDP=0x1f for SDP.
Implement function `tester_init_sdp` and `tester_unregister_sdp`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Broadcast ID is 24bits and uinitialized broadcast_id resulted in
(pseudo) random failures since only 3 bytes were set by call to
bt_rand().
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This helps to circumvent issues in current BAP implementation when
multiple streams are present. Also puts RX path in line with
configuration of TX path.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add two optional arguments to shell commands `sdp_client sa_discovery`
and `sdp_client ssa_discovery`.
The first argument is the beginning of the attribute ID.
The second argument is the ending of the attribute ID. If the second
argument is omitted, the ending of the attribute ID is 0xffff.
Add test case `test_sdp_ssa_discover_multiple_records_with_range` to
test the ssa request with attribute ID list.
Add test case `test_sdp_sa_discover_multiple_records_with_range` to
test the sa request with attribute ID list.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Modify the code to use the public API to get the endpoint
ID and direction rather than relying on the internal
bap_endpoint.h header file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_ascs_ase_status was stored directly in the
struct bt_bap_ep, which was an issue as
bt_ascs_ase_status is a variable sized struct.
The struct could have been moved to the end of
bt_bap_ep to avoid the issues it caused, but
there is no actual reason to use that struct
rather than storing the ID and state as
seperate values.
The ascs_ep_get_state exists but was not widely
used in ascs. Modify places to use the function
instead of directly accessing the state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is used for properly tracking if legacy or extended advertising
API is used and should not be changed if advertisign is enabled.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
If extended advertising was used GAP module was always creating
new instance on advertising start (while failing to stop it at
the same time).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add support for setting and getting the bearer provider
name. For now the name will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the name exists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify values in audio.conf to reduce memory usage.
Most notably disabling logs reduced the FLASH requirements.
Ideally the shell works as expected without debug logs, but
there are far too many profiles and services to verify them all.
All the log options are left in audio.conf so they can easily be
re-enabled when needed.
Memory before this change:
Memory region Used Size Region Size %age Used
FLASH: 1018512 B 1 MB 97.13%
RAM: 423146 B 448 KB 92.24%
IDT_LIST: 0 GB 32 KB 0.00%
Memory after this change:
Memory region Used Size Region Size %age Used
FLASH: 791308 B 1 MB 75.47%
RAM: 369090 B 448 KB 80.46%
IDT_LIST: 0 GB 32 KB 0.00%
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The error code instead of `BTP_STATUS_FAILED` of the function
`bt_le_ext_adv_create()` should be returned.
Returns the error code returned by `bt_le_ext_adv_create()`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>