Fix the missing use of remainder value in the sync_offset_us
calculations. Also, Periodic Sync reception is relative to
Peripheral event hence ticks_anchor does not require the
ticker margin and event jitter to be subtracted.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a dependency for UTF8 for LE Audio. Since (nearly?) all
string in LE Audio are UTF8 and that the stack wants to be
able to check and validate strings coming both from remove
deviecs and from the application, it will depend on the utf8
API that is guarded by CONFIG_UTF8.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
cmd_blob_target() always returned 0 even when the target list was
full, making error checks at call sites unreachable.
Return a proper error code when no more targets can be added so
callers can correctly detect and handle the failure.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
CAR characteristic read process was incomplete, CAR status was not
actually stored.
Added a new BTP_GAP_EV_PEER_CAR_RECEIVED to tester. This is to
prevent disconnect events before IUT successfully reads CAR from
central.
Updated start_directed_advertising() so that if the central has
no CAR support we must not send directed advertisements. IUT
might enter another connectable mode according to specification,
thus IUT starts sending connectable undirected advertisements with
resovable address.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
When building with clang it warns about self-assignment in the
bluetooth.classic.sdp_s test:
tests/bluetooth/classic/sdp_s/src/sdp_server.c:258:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
258 | sh = sh;
| ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:277:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
277 | sh = sh;
| ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:290:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
290 | sh = sh;
| ~~ ^ ~~
tests/bluetooth/classic/sdp_s/src/sdp_server.c:368:5: error: explicitly
assigning value of variable of type 'const struct shell *' to itself
[-Werror,-Wself-assign]
368 | sh = sh;
| ~~ ^ ~~
4 errors generated.
The "sh" variable is used later in the functions.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Since this file is not built with the documentation system,
some of the references didn't work. References to tools, boards,
etc. have been encapsulated by the appropriate ticks.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for getting the UCI.
For now the UCI will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the UCI exists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Btp got support of EAD in f04d0196de, enabling config flag will enable
GAP/SCN/BV-01-C and GAP/ADV/BV-20-C to be executed
Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
Aligned with changes in pytest plugin, where added support
of multiple connections from one device.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
The existing ASCS test callback verification functions scale poorly and are
not easily reusable across different cases.
This change introduces a more generic approach to expectation checks by
adding `expect_bt_bap_unicast_server_cb_release_called(_expected_count,
_streams)` and similar functions, improving readability and maintainability
of ASCS unit tests.
Fixes#58034
Signed-off-by: Dima Kushchevskyi <d.kushchevskyi@sirinsoftware.com>
Fix build issues,
- error: format %x expects argument of type
unsigned int, but argument 7 has type ssize_t
{aka long int} [-Werror=format=]
zassert_false(ret < 0, "attr->read returned unexpected (err 0x%02x)"
, BT_GATT_ERR(ret));
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.
Duplicates inside different #ifdef branches are preserved
as they may be intentional.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
In the case, when the connection is established on the local side, the
test script will require peer device to send ACL disconnection
request. But due to the timing issue, the connected event may be not
notified on the peer device side when the peer device received the ACL
disconnection requirement. The exception will happen. It causes the
case to fail.
Wait for the connected event of the peer device before sending the ACL
disconnection request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The case `sdp_discover_with_range` will consume much time to
exhaustively enumerate all supported attribute id ranges. It will
consume much time.
Optimize the set of the supported attribute ID ranges to reduce
the time consumption.
Such as, the discovered attribute ID list is [1, 2, 3, 4, 7, 9, 256].
In the original implementation, the range count is 35511. While in
the optimized range count is 105.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
For the case sm_key_persist_004, the disconnected event may be
printed before the log `Pairings successfully cleared` since there
is no order between log `Pairings successfully cleared` and the
disconnected event. It causes the script discards the disconnected
event in this case and rise the assert issue.
For the case sm_key_persist_004, check the disconnected event in
the captured log. If it is not found, wait the disconnected event
until timeout.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
For the case sm_init_035, the similar issue also be found. The
message `Enter 16 digits wide PIN code for` may be printed after
the shell prompt. The assert issue also be found in this case.
For the case sm_init_035, check the message `Enter 16 digits wide
PIN code for` in the captured log. If it is not found, wait the
message until timeout.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The shift is an old leftover from when the BAP API was
different and BIT(1) means BIS Index 1, but now BIT(0)
means BIT Index 1.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Enable the CAP Commander role for the BT tester. This will
help pass some TMAP and GMAP tests that require the CAP
Commander to be enabled.
The actual implementation of the tests related to the
CAP commander is not implemented.
TMAP also requires that handover is supported if we
support both unicast and broadcast, so enable the config
for now. Support for the handover tests will follow in
a separate commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In current implementation, the useless for loop is called in function
`_wait_for_shell_response()` if the target message has been found. It
causes the case will consume too much time.
Exit the useless for loop to reduce the time consumption when the
target message is found.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current implementation, the useless for loop is called in function
`_wait_for_shell_response()` if the target message has been found. It
causes the case will consume too much time.
Exit the useless for loop to reduce the time consumption when the
target message is found.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Sometimes, the command `rfcomm_s send 9 1` will fail to execute due
to the DLC has not been established.
Check the DLC connected event before sending shell command
`rfcomm_s send 9 1`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Many dts/dtsi files where its dt-bindings are in-tree
do not include zephyr prefix in the #include path.
Add it to make it consistent globally.
Some dt-bindings that resides in hal can not be changed.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Match number of supported periodic advertising instances with
configure extended advertising instances and increase number
of advertising buffers to match qualification tests requirements.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists
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>
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists,
and cleans up the code.
Since the kernel is actually running, we also need to support
that e.g. k_work items are actually scheduled, and that we have
to wait for them to finish. test_drain_syswq has been implemented
as a way to drain the system workqueue before we check for
callbacks or perform subsequent actions.
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists,
and moves the mock bap_broadcast_source.c file to the
correct location.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
- When we are a peripheral we want to be able to start a stream
from the stream_connected_cb, given that we are in an enabling state
and the stream is in the sink direction
Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
wid 145 requests handle of a UUID of a long characteristic. wid 167
requests to remove the characteristic by handle requested in wid 145.
2 new commands are added to support these wids:
- BTP_GATT_GET_HANDLE_FROM_UUID to request handle of a certain UUID
- BTP_GATT_REMOVE_HANDLE_FROM_DB to remove attribute by handle.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Rename generic FEM binding to use 'radio-' prefix for consistency with
other radio bindings (radio.yaml, ble-radio.yaml).
Updated 3 board files, Nordic BLE controller HAL, documentation, and
test overlays. Added missing settle-time properties to pan1783a board.
Signed-off-by: Ivan Pankratov <ivan.pankratov@silabs.com>
Some of the CAP initiator unit tests did not delete the group
after creation, even if they easily could.
Especially for test_initiator_unicast_group_add_streams it was
a problem, as the stream added was stack allocated, and by the
end of the test it was deallocated, causing issues when the
group was finally deleted in
cap_initiator_test_unicast_group_after.
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.
To support mocking we cannot rely on the default
Kconfig options and values. The required Kconfig options
to satisfy dependencies are overridden in the Kconfig
file and the necessary Kconfig files are sourced.
We cannot enable e.g. CONFIG_BT as that would attempt
to pull in a lot of files we do not want in this test.
This commit also removes unused includes in the CMakelists
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for connecting the CIS in QoS state.
To support this some checks were added to check the CIS
state while entering the enabling state, as well as the
ASE state when the CIS was connected to determine when to
send the ASE start opcode.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If the option BTP_L2CAP_CONNECT_V2_OPT_HOLD_CREDIT or
BTP_L2CAP_LISTEN_V2_OPT_HOLD_CREDIT is set, set the local flag
`hold_credit`. When the data received, holds the buffer and returns
the error code `-EINPROGRESS`.
The held buffers will be released if the L2CAP channel disconnect
callback is triggered. Or only of the held buffers will be released
if the L2CAP BTP command `credits` is received.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If `CONFIG_BT_CLASSIC` and `CONFIG_BT_L2CAP_MAX_WINDOW_SIZE` are
defined, set the TX data buffer count to
CONFIG_BT_L2CAP_MAX_WINDOW_SIZE. Or, set the TX data buffer count to
CHANNELS.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>