Add missing license and copyright notices to tests ST boards
configuration and DTS overlay files. See shell commands used in
https://github.com/zephyrproject-rtos/zephyr/pull/107404.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The provided name `inval_bearer_name` were not correctly set
as too long as it was not properly NULL terminated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Apply ARG_UNUSED() to unused function arguments as per the Zephyr
coding guidelines
Assisted-by: GitHub Copilot
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Apply the U suffix to unsigned integer literal constants used in
contexts involving unsigned types (uint8_t, uint16_t, uint32_t,
uint64_t, size_t, etc.) with coding guideline 40 which requires that
a U suffix be applied to all unsigned integer constants.
Changes are limited to literal values in assignments, initializations,
comparisons, and for-loop bounds where the context is unambiguously
unsigned.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add missing error checks for any function calls in the
affected files, as that is required by the Zephyr coding guidelines.
Assisted-by: Copilot:claude-sonnet-4.6
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adding BTP_GAP_PAWR_CONFIGURE command to be able support the
following PAwR tests.
Required for following test cases:
GAP/PADV/PAM/BV-02-C
GAP/PADV/PASM/BV-02-C
GAP/PADV/PAST/BV-03-C
GAP/PADV/PAST/BV-04-C
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
Apply ARG_UNUSED() to unused function arguments as per the Zephyr
coding guidelines
Assisted-by: GitHub Copilot
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The technology values defined in tbs.h are actually defined
in assigned numbers under the HFP. They have been moved to
the assigned_numbers.h file, and name to match the placement
in Assigned Numbers. They have been defined in an enum instead
of multiple #define's, to more easily refer to them.
The callback for reading technology was likewise updated to use
the new enum.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add pytest test scenarios to demonstrate the multi-DUT testing
feature in Twister:
- peripheral_ht/central_ht: verify BLE connection and Health
Thermometer data exchange between two devices
- bluetooth/shell: verify BLE connect/disconnect flow using
shell commands on two devices
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This adds several new tests for a combination of newly introduced
Kconfig options related to the CSIS set, lock and rank characteristics.
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
Make the Coordinated Set Size, Set Member Lock and Set Member Rank
characteristic optional by adding three new Kconfig options
BT_CSIP_SET_MEMBER_SIZE_SUPPORT, BT_CSIP_SET_MEMBER_LOCK_SUPPORT and
BT_CSIP_SET_MEMBER_RANK_SUPPORT. Also updates the existing examples
and tests to compile correctly.
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
Instead of defining the same arguments in all 3 CAP files,
we declare them in audio.h and initiate them in either
the initiator or commander, depending on their use.
The reason for this change, is that the CAP Handover API
require several of the parameter to be globally/statically
allocated, and cannot just rely on stack allocated parameters.
By doing this, we can use the same argument among the
CAP shell modules, while keeping the memory usage down.
This has the additional postive effect that we do not allocate
some of these arrays, which can be quite larger, on the stack.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Check that we can create up to CONFIG_BT_ID_MAX IDs and
that deleting an ID allows us to create another one.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add checks to verify the valid length of broadcast names
in codec_cfg and codec_cap, both in terms of size in octets,
but also in terms of length in characters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add checks to verify the valid length of broadcast names
in codec_cfg and codec_cap, both in terms of size in octets,
but also in terms of length in characters.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
MISRA-C requires essentially boolean types in control flow.
Convert all if/while conditions using err or ret
as implicit booleans to explicit comparisons:
- if (err) -> if (err != 0)
- Same rules applied to while statements and ret variable
Also fix typos found during review:
- Fix "Failed to ser security level" -> "Failed to set security
level" in pacs_notify_client_test.c (4 places) and
csip_notify_client_test.c (2 places)
- Fix "Bluetoot" -> "Bluetooth" typo in media_controller_test.c
- Fix format/argument mismatch in bap_scan_delegator_test.c:
add missing `i` argument to FAIL() call
Assisted-by: GitHub Copilot
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Disable the second uart in the xterm-native-shell overlay
(we do not need to UARTS, but having them both connected will confuse
users)
Fix the run-bsim script. It had rotten and had quite many issues,
let's fix them:
* Fix the build command example so it actually builds and is configured
in a sensible way given how this script uses the executable
(if we attach to the uart a terminal it should be in its own pty)
(there is no global xterm-native-shell snippet)
* When stopping a possible previous bsim simulation, let's only stop
the one we launch from this script, not any running in the computer
* Do not run the bsim handbrake from inside their artifacts folders, but
from the installation folder (BSIM_OUT_PATH/bin)
* Add a timeout to stop the simulation after 1 hour so it does not linger
forever
* Set LD_LIBRARY_PATH, as we are running the device .exe from an arbitrary
folder
* Use the Execute bsim shell utility function, so we stop all programs
in the background with Ctrl+C instead of letting them linger.
* Add explanation of the used command line parameters
* In the parameters to zephyr.exe:
* Do not set the random seed unnecessarily (it is already a valid value)
* Do not ask to wait for something to attach to the uart (we are telling
the executable to automatically do it)
* Set a small maxium synchronization delay with the phy (10ms) so the
simulation appears fluid for interactive use
* Don't pushd when changing directory, we are in a subshell and will not
popd
* Set the handbrake in actual real time instead of 10x. Set a small period
for the handbrake, so the simulation feels fluid.
* Add a call wait_for_background_jobs so we wait for all programs in the
background.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Make the qos parameter of the BAP can CAP APIs const,
as they are now only used as one-time parameters, and not stored.
This also means that any uses of this can place the qos
parameter in the stack, rather than static memory.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add Message Access Profile (MAP) shell command support to the
Bluetooth shell module.
Add map.c to the CMakeLists.txt build configuration when
CONFIG_BT_MAP is enabled, allowing MAP shell commands to be
compiled into the shell module.
Enable MAP configuration options in the Bluetooth shell test
configuration, including both MCE (Messaging Client Equipment)
and MSE (Messaging Server Equipment) functionality.
This enables testing and demonstration of MAP profile features
through the Bluetooth shell interface.
Signed-off-by: Can Wang <can.wang@nxp.com>
Add Phone Book Access Profile (PBAP) implementation for Bluetooth Classic,
supporting both Phone Book Client Equipment (PCE) and Phone Book Server
Equipment (PSE) roles.
PBAP enables remote access to phone book data stored on a device,
allowing clients to retrieve contact information, call history, and
other phonebook-related data.
Key features:
- PCE (client) and PSE (server) role support
- RFCOMM and L2CAP transport layer support
- Pull phone book, vCard listing, and vCard entry operations
- Set phone book navigation (up/down/root)
- Abort operation support
- OBEX authentication (challenge-response with MD5)
- Application parameters for filtering and formatting
- SDP service registration and discovery
- Single Response Mode (SRM) support for GOEP v2
- Configurable PSE features (download, browsing, database identifier,
folder version counters, vCard selector, enhanced missed calls, etc.)
- Configurable PSE repositories (local phonebook, SIM, speed dial,
favorites)
The implementation includes:
- Core PBAP protocol handling (subsys/bluetooth/host/classic/pbap.c)
- Public API header (include/zephyr/bluetooth/classic/pbap.h)
- Internal definitions (subsys/bluetooth/host/classic/pbap_internal.h)
- Shell commands for testing and demonstration
(subsys/bluetooth/host/classic/shell/pbap.c)
- Comprehensive shell documentation with usage examples
(doc/connectivity/bluetooth/shell/classic/pbap.rst)
- Kconfig options for feature and repository configuration
- Build system integration (CMakeLists.txt)
- Logging support
Authentication uses PSA Crypto API (MD5) for nonce generation and
response digest calculation.
Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
There's no need for bt_dev.random_addr to be a bt_addr_le_t, since the type
is always implicitly random. Change it to bt_addr_t and make the necessary
updates to the host code as well as host unit tests.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Implement proper handling and storage of the broadcast code for encrypted
BTP BAP broadcast sink sync. This ensures the broadcast code is correctly
passed to the controller, allowing encrypted broadcast audio tests to pass.
Signed-off-by: Alex Ciascai <alexandru.ciascai@nordicsemi.no>
Add tests to verify antenna switch pattern validation when only
BT_HCI_LE_AOD_CTE_RSP_2US is set. The existing tests use all CTE
types combined, which means a regression specific to AoD 2US would
not be caught.
Signed-off-by: Andre Viegas <andreviegas@piscodeluz.org>
Assisted-by: Claude:claude-opus-4.6 ForgeQL
Update btp_vcp.c to manage volume controller instances per connection
using the connection index. With this change, the VCP tester can
handle multiple LT connections independently, ensuring correct
behavior in multi-IUT test scenarios.
Signed-off-by: Alex Ciascai <alexandru.ciascai@nordicsemi.no>
Fixed issue where an aborted CAP commander procedure would
never get past bt_cap_common_proc_all_handled and thus never
call the callback with an error, e.g. if the remote CAP
Acceptor rejects a request.
The fix required a significant refactor of the broadcast
part of the CAP commander, as it was fundamentally flawed.
The biggest change is that the implementation now uses both
the receive state notification as well as the write responses
to determine completeneess. Additionally, it also handles
notifications not initiated from our write requests, i.e.
it is now more similar to an event based procedure rather
than a linear one. This also means that when the callbacks
for the start and stop procedures are now called, we have
receive the events (notifications) from the remote CAP
acceptors that they are actually synced (or not synced) to
the broadcasts.
Since the broadcast reception start and stop now waits
for the receive state to be updated, a change in the
Handover implementation was also done.
To test the solution 2 new test cases were added,
and the existing tests were modified to allow for the
new expected behavior.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
ASE ID was not set in stream configured callback causing
BTP_ASCS_EV_OPERATION_COMPLETED event to miss proper ASE ID.
This leads to excesive timeouts in AutoPTS BAP tests.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Take advantage of the new string conversion helpers to avoid having to
declare explicit on-stack variables.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The Bluetooth stack has until now had private helpers to return an inline
pointer to a string - something which can be useful e.g. as part of
printk()/printf() call parameters. The reason these were never made public
is that they are not safe when a format string contains more than one
invocation of these.
This commit introduces replacement APIs which allocate an on-stack buffer,
thereby allowing arbitrary number of calls within the parameters of an
output formatting call. The new APIs are defines, since the solution uses
an encapsulating struct to force an on-stack copy, which then requires a
translation to access the struct-internal string member variable.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Make the codec_cfg parameter of the BAP can CAP APIs const,
as they are now only used as one-time parameters, and not stored.
This also means that any uses of this can place the codec_cfg
parameter in the stack, rather than static memory.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The pointer represent the codec configuration
for a stream based on the ASE or broadcast configuration,
and serves as a read-only value. Changing it to `const` makes
this more clear.
Some minor changes were done to existing code to help
support this change.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
For GAP/CONN/DCON/BV-05-C PTS expects IUT to fail operation
if the peer does not support Central Address Resolution.
In Test Set there is ALT to start undirected advertising instead
but PTS interpretation is that IUT shall reject directed request
regardless and may then later on follow up with underected
advertising (which PTS doesn't validate). To keep this simple
just reject here.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Modify foreach functions in LE Audio to follow the same pattern:
Return true to continue iterating.
Return false to stop iterating.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
TF-PSA-Crypto's bignum module includes some assembly optimization for
x86, x86_64 and ARM64 platforms. When building for "native_sim/native"
on a 64 bit platform the compiler tries to set 32 bit compatibility mode,
but of course assembly functions between 32 and 64 bits architectures
don't match and therefore the build fails.
Disabling optimizations prevents TF-PSA-Crypto from trying to use
assembly and the test passes.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
These tests directly reference Mbed TLS/TF-PSA-Crypto include path in
their CMakeLists file. This commits adjust the path with new values.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
bt_uuid_from_str() uses hex2bin() from lib/utils/hex.c and
uuid_from_string() from lib/uuid/uuid.c. Add both dependencies
to each test CMakeLists.txt that compiles
subsys/bluetooth/host/uuid.c, fixing link failures on the
unit_testing platform.
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
Add comprehensive unit tests for bt_uuid_from_str and bt_uuid_compress
functions to ensure proper conversion of string representations to
Bluetooth UUID structures. Tests cover:
- 16-bit UUID string conversion (e.g., "180d")
- 32-bit UUID string conversion (e.g., "abcdef12")
- 128-bit UUID string conversion with standard format
- Invalid input cases (malformed strings, empty strings, wrong lengths)
- bt_uuid_compress: 128-bit base UUID to 16-bit and 32-bit
- bt_uuid_compress: non-base 128-bit UUID returns -ENOTSUP
- bt_uuid_compress: 16-bit passthrough
Includes proper validation of converted UUID values against
expected results using bt_uuid_cmp().
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
Replaces usage of these deprecated macros with ones that support
fixed and mapped partition compatibles. Also includes an update to
hal_espressif which also (rightly or wrongly) has zephyr specific
code in it
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adding subrating request BTP CMD to tester. Since ZLL does not
support subrating, it is not enabled by default in tester config.
Subrating request is already supported by AutoPTS GAP.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
Remove the Kconfig option BT_TBS_SUPPORTED_FEATURES as it was
not used by the subsystem, but only by applications.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify bt_ccp_call_control_server_get_bearer_uci to
store the bearer UCI in an output buffer, instead of just
providing the pointer.
The reason for this is to make the result thread safe, and
avoid the user/application having a direct pointer to
internal storage.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Set the CONFIG_BT_CTLR_SYNC_ISO_STREAM_MAX and
CONFIG_BT_CTLR_ADV_ISO_STREAM_MAX to match the
CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT and
CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT count.
This also fixes a compile issue since
CONFIG_BT_ISO_MAX_CHAN=2 and the controller configs
cannot be higher than this.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>