Use CLOCK_REALTIME for the default clock source throughout
the POSIX implementation and tests so that we are
consistent with the specification.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
pthread_timedjoin_np() is allowed to take a negative tv_sec
parameter, since that is still a valid timespec.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Update the includes so that only what is actually used is included,
and so that everything is used is includes (IWYU).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add test case bluetooth.general.tester_br_edr.
Add overlay `zephyr,sram` and `zephyr,uart-pipe` for the board.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Set following configuration by default,
CONFIG_BT_CLASSIC=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_PAGE_TIMEOUT=0xFFFF
When building the project, the argument `--extra-conf prj_br.conf`
needs to be appended for BR.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the L2CAP connection response of command `listen` is
`BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_SEC_AUTHEN`, set the security
level of L2CAP server to level 4.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The error code `-EBUSY` of `bt_conn_set_security` means the
pairing/encryption procedure is ongoing. Ignore the error code.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Compare with BTP GAP pair, the pair_v2 add more arguments, including
security mode, security level, and flags.
The argument `security mode` is used to set the security mode.
The argument `security level` is used to set the security level of the
specific security mode.
The argument `flags` is used to add additional setting, such as flag
`BTP_GAP_PAIR_V2_FLAG_FORCE_PAIR` is used to force the pairing
procedure.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Change the channel id rage of BR L2CAP channel to
`ARRAY_SIZE(channels)` ~ `ARRAY_SIZE(channels) + CHANNELS`. The
unified channel ID can help identify whether the channel is BR or BLE
L2CAP channel.
When the address type of L2CAP connect command is
`BTP_BR_ADDRESS_TYPE`, create BR L2CAP channel connect request.
And if the channel ID falls into the range `ARRAY_SIZE(channels)`
~ `ARRAY_SIZE(channels) + CHANNELS` of L2CAP disconnect command,
create BR L2CAP disconnect request.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Create BR connect if the address type is `BTP_BR_ADDRESS_TYPE` when
handling BTP GAP `connect` command.
Disconnect BR connect if the address type is `BTP_BR_ADDRESS_TYPE`
when handling BTP GAP `disconnect` command.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Call `bt_br_discovery_cb_register` to register discovery callbacks.
Define a buffer br_adv_buf to report br discovery result.
Report device found event if discovery received callback triggered.
Start BR device discovery procedure if command `start_discovery` is
received.
Stop BR device discovery procedure if command `stop_discovery` is
received.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Set the pin code request callback `auth_pincode_entry`.
If `highsec` is false, call `bt_conn_auth_pincode_entry` with pin code
"0000".
If `highsec` is true, call `bt_conn_auth_pincode_entry` with pin code
"0000000000000000".
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If cp->transport is BTP_L2CAP_TRANSPORT_BREDR, register BR L2CAP
server.
If cp->transport is not one of BTP_L2CAP_TRANSPORT_BREDR and
BTP_L2CAP_TRANSPORT_LE, return error code BTP_STATUS_FAILED.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Disable connectable mode for classic if `cp->connectable` is false.
Enable connectable mode for classic if `cp->connectable` is true.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Disable discoverable mode if `cp->discoverable` is
`BTP_GAP_NON_DISCOVERABLE`.
Set general discoverable mode if `cp->discoverable` is
`BTP_GAP_GENERAL_DISCOVERABLE`.
Set limited discoverable mode if `cp->discoverable` is
`BTP_GAP_LIMITED_DISCOVERABLE`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Set the supported settings `BTP_GAP_SETTINGS_BREDR` and
`BTP_GAP_SETTINGS_SSP` if the Bluetooth classic is enabled.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit resolves lock contention
issues by increasing the probablity of
contention during the test execution.
Increased wait delay when lock is taken
and Reduced wait delay when the lock is
released.
Achieved 99% lock contention probablity,
verified through runtime metrices.
Signed-off-by: S Swetha <s.swetha@intel.com>
For the flash with the block size equal to or smaller than 64 bytes,
using a specific "32" bytes for adding for destination_offset and "32"
bytes for subtracting the size that need to copy is not correct.
As a solution, I will add one-fourth of a block size for the
destination_offset and modify the size that need to copy to
[block size + one-fourth of a block size].
Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Restore userspace testing that was removed with commit 'aa2b72d32a
(tests: logging: remove userspace testing, 2024-04-10)' and reported in
the issue #49213.
For the tests running with threads in user space (with ZTEST_USER),
the memory partitions are configured in the test-suite setup.
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
Bad Broadcast Code in BASS/Scan Delegator if BIG_Encryption
field value = 0x03 (Bad_Code), Bad_Code shall be set to the
value 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF according to BASS v1.0.1
Signed-off-by: Gudipudi Ramana Kumar <gudipudiramanakumar@gmail.com>
Commit f7633a55aa moved the tests for the
POSIX_SEMAPHORES Option Group from the tests/posix/common testsuite to
its own dedicated testsuite.
However, there was a copy-paste error. Previously, tests would have been
run only once when dynamic threads were enabled, and then skipped when
dynamic threads were disabled, since that follows the posix programming
model better. However, dynamic threads were never actually enabled after
moving to the new testsuite. So all tests were effectively skipped.
Add the necessary options to prj.conf in order to ensure that there are
sufficient dynamic threads available to run the testsuite.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
There is no reason to use a 5s wait time in tests. This can add up quite
significantly across multiple platforms that execute in real-time under
qemu (or even just on real hardware).
Speedup observed with qemu_cortex_a53/qemu_cortex_a53/smp
Before:
```
START - test_named_semaphore
PASS - test_named_semaphore in 5.688 seconds
```
After:
```
START - test_named_semaphore
PASS - test_named_semaphore in 0.783 seconds
```
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Release completion queue events left over from the previous test and
make sure a completion queue event gets released after it is consumed.
Otherwise newer cqes may be unable to be submitted due to completion
queue being full.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Add dedicated test case `bluetooth.classic.sdp.server.no_blobs` and
`bluetooth.classic.sdp.client.no_blobs` with the extra argument
`CONFIG_BUILD_ONLY_NO_BLOBS=y` and `build_only: true` to make sure the
tests sdp_s and sdp_c can be passed by Zephyr CI.
Fixes#88060.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>