IAD must be before the interfaces it associates and therefore there is
no need for the class to be in charge of updating the bFirstInterface.
Update IAD in common initialization code and remove the updates from
classes.
This fixes UAC2 instances where the IAD bFirstInterface is not 0, e.g.
when HID was used together with UAC2.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Currently, there are build warnings that are triggered when building
for BT central and legacy OOB pairing only:
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY=y
CONFIG_BT_CENTRAL=y
There was a PR that handled this issue in the past https://github.com/zephyrproject-rtos/zephyr/pull/74400.
Unfortunately, this PR even though it fixed the warnings it also
broke the BT peripheral and legacy OOB pairing only build:
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY=y
CONFIG_BT_PERIPHERAL=y
https://github.com/zephyrproject-rtos/zephyr/pull/82552 was merged in
order to fix the issue with the peripheral build configuration.
Unfortunately, this PR reintroduced the warnings for BT central and
legacy OOB pairing.
This commit brings changes to make sure that both the BT central and
peripheral builds with OOB legacy pairing are buildable and
warnings free.
Also in this commit, a new build test case is added for the BT central
and legacy OOB pairing along the existing BT peripheral test case
Signed-off-by: Sebastian Panceac <sebastian.panceac@ext.grandcentrix.net>
This removes the deprecated CONFIG_NET_PKT_BUF_DATA_POOL_SIZE.
User should either use CONFIG_NET_PKT_BUF_RX_DATA_POOL_SIZE or
CONFIG_NET_PKT_BUF_TX_DATA_POOL_SIZE depending of net packet type.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT and
CONFIG_NET_TCP_RETRY_COUNT to control the total timeout at the TCP
level.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
RTT backend can only be called from thread context and immediate
logging might lead to interrupt context use. Previously this limitation
was implied in different way and commit (c88a9ef27) got reverted.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add a separate test for public key validity. This needs to be done
synchronously so that we can respond with an early failure message to the
peer device.
Fixes#80218
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
If a shell command does not have a sub command, then the 3rd parameter
to SHELL_SUBCMD_ADD() macro should be set to NULL so that the help
will only print information specific to that command and not all
wifi commands.
Fixes#82633
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When calling wifi_ap_disable() API specific WiFi driver implementation was
checked whether 'ap_enable' was provided, instead of 'ap_disable'. Fix
that copy-paste error.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Re-ran `clang-format` for consistent styling, simplified
multi-line statements, and consolidated string concatenations
where applicable.
This is a non-functional change focused on code formatting.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Added shell_device_get_binding() that wraps device_get_binding() plus
device_get_by_dt_nodelabel() so that a shell can easily get a device by
its full name or label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
The weak syscall symbols generated by gen_syscalls.py are currently
compiled in the LLEXT subsystem library, which is then linked among all
other Zephyr libraries in an unspecified order. This can cause the weak
symbols to override the actual syscall implementations, leading to
undefined behaviour.
To fix this, the currently generated file is split in two elements:
- syscall_exports_llext.c contains the EXPORT_SYMBOL directives for all
syscalls. This part can be compiled with the LLEXT library and linked
among all other Zephyr libraries, and ensures all syscalls symbols
are preserved by the linker.
- syscall_weakdefs_llext.c contains the weak definitions for all syscalls.
This file is compiled in a separate library that is linked last, so
that the weak symbols are only used if no other implementation is
available.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
In current implementation, the SDP response packet will be ignored if
the operation code is `BT_SDP_ERROR_RSP`. And the SDP transaction
request is done, but the application is not notified. And the pending
SDP transaction cannot be processed.
Notify application with empty buffer if the operation code is
`BT_SDP_ERROR_RSP`. And process the pending SDP transaction.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The discovered SDP record of service attribute transaction response
cannot notified correctly. There is an error returned from function
`get_record_len()`.
For service attribute transaction response, only one attribute list
is returned. So the total record length is the buffer length. Return
buffer length directly from `get_record_len()` to fix the issue.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit replaces the assignment of IS_ENABLED(x) macros to
various variables with direct condition checking. This should fix the
coverity issue and also promotes more uniformity in code.
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Logging with STMESP frontend is using custom logging header feature.
Put that specific header file in a custom path which is added to the
build only if that logging frontend is used.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
To signal to the mesh extended advertiser that a proxy advertisement is
started, `bt_mesh_adv_gatt_send()` is called in combination with
setting the `ADV_FLAG_PROXY` flag in adv_ext.c. This ensures that it
won't try to start the advertiser again, which would result in the
controller rejecting it.
Setting this flag outside adv_ext.c is not viable, and as such calling
`bt_mesh_adv_gatt_send()` should also be limited to the advertising
source code.
As it stand now, once we utilize the new commit priority for `h_commit`
calls such a recall of `bt_mesh_adv_gatt_send()` with following
rejection by the controller will happen.
Within the `bt_mesh_resume()` function we can confidently assume the
extended advertiser has already been started. As such we can call
`bt_mesh_adv_gatt_update()` instead of `bt_mesh_adv_gatt_send()`.
This change has been tested with both running relevant bsim tests after
rearranging in which order the settings of the subsystems are loaded via
`h_commit`, as well as a modified light switch sample, adding
`bt_mesh_resume/suspend` calls on buttons.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
Add support for handling optimized short log messages (aka turbo logs).
There are 2 types of turbo log messages:
- No arguments. D16MTS is used for that on channel > 32768
- One numeric argument. DM16 followed by D32MTS is used.
Additionally, in order to be able to get source name for log messages
coming from owned by cpuapp co-processors (PPR and FLPR) there must
be a way of passing location of constant source data from PPR/FLPR to
cpuapp which handles ETR data. This method is added in the commit as
well. PPR/FLPR sends D32M during the boot with address of constant
source data section. Demultiplexer stores those addresses and it is
able to retrieve source name for log messages from PPR/FLPR.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add 'turbo' logging feature. When enabled, short logs (no argument
or one numeric, 32 bit argument) are handled in a special way that
is much faster than the default one (5-10x faster). Additionally,
there is an option to remove all other logs from the system which
allows to not include almost any logging framework code in the
binary (~170 bytes of code is needed). It may be especially
valueable for memory constraint targets (ppr, flpr) where with
only 170 byte of code (+code for each log message) we can provide
limited formatted string logging support.
'Turbo' logging is using following to achieve that:
- logging strings are put into a memory section and additional
memory section is created which holds addresses of those strings.
Index in that array is used to identify a string (32 bit address
is encoded into a smaller number, 15 bits is more than enough).
This index is used for a STMESP register set (there are 2^16
available). So STMESP channel encodes string.
- Logging level is stringified and prepended to a string
- Source ID is encoded by using DM16 (so far not used).
- Log without arguments is written as DMTS16
- Log with one argumetn is written as DM16+DMTS32
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Set initial filtering settings in the log core init only if
runtime filtering is enabled. It saves few bytes when runtime
filtering is off.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The Bluetooth data buffer API currently lacks a mechanism to notify when
a buffer is freed in the RX pool. This limitation forces HCI drivers to
adopt inefficient workarounds to manage buffer allocation.
HCI drivers face two suboptimal options:
- Blocking calls: Use bt_buf_get_rx with K_FOREVER, which blocks the
execution context until a buffer becomes available.
- Polling: Repeatedly call bt_buf_get_rx with K_NO_WAIT, which increases
CPU load and reduces efficiency.
This commit introduces a callback mechanism that is triggered each time
a buffer is freed in the RX pool. With this feature, HCI drivers can:
- Call bt_buf_get_rx with K_NO_WAIT.
- Wait for the callback notification if a NULL buffer is returned,
avoiding unnecessary polling.
The new callback improves efficiency by enabling event-driven behavior
for buffer management, reducing CPU overhead while maintaining
responsiveness.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The asserts were not proper here, replace those by runtime
checks as the functions can be called from applications and
asserts are not meant for error checking.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add "bandwidth" parameter to "wifi ap enable" command.
Add "ht_capab" and "vht_capab" parameters to "wifi ap config" command.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Replaced `sys_cpu_to_le16(1)` with a direct `1` assignment to the
`cp->num_handles` (uint8_t) field to avoid truncation to `0x00` on
big-endian architectures.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
now that CONFIG_POSIX_C_LANG_SUPPORT_R will
add a custom implementation for gmtime_r() if that
is not provided by the toolchain, we can simply depend on
that, instead of using out own.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Actively disconnect the connection with error code `BT_HCI_ERR_AUTH_FAIL`
when the notified link key type is not `BT_LK_AUTH_COMBINATION_P256` in
BR SC only mode.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Currently, the minimum value of encryption key size is
`BT_HCI_ENCRYPTION_KEY_SIZE_MIN`.
Add a new Kconfig `BT_BR_MIN_ENC_KEY_SIZE`. It is used to set the
specific minimum encryption key size.
The default value is `BT_SMP_MIN_ENC_KEY_SIZE`. And it can be
configured if `BT_SMP_SC_ONLY` is not enabled.
Use `CONFIG_BT_BR_MIN_ENC_KEY_SIZE` as minimum encryption key size in
`br_sufficient_key_size`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
policy engine errors were unconditionally setting the state back
to sink ready. this fix sets the correct state based on the current
power role.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
when not clearing cc_voltage the type-c current limit
will only be reported on the first plug in.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
Add the bt_ prefix when registering logging for the media_proxy module,
to be consistent with what the other modules in bluetooth/audio do
Note that the bap_usb module shall not have the bt_ prefix
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Compilation errors in ptp library when using C++ compiler.
First error is due to 'class' keyword being reserved in C++
and 'class' is used as a variable name in ptp library.
Second error is due to a flexible array member in a struct
is not placed at the end.
Signed-off-by: Tomas Choat <trc@ixys.no>
The asserts always fail because the condition is inverted.
This patch fixes the condition to verify the socket
is lower than PTP_SOCKET_CNT.
Signed-off-by: Tomas Choat <trc@ixys.no>
When the offset is larger than 1 second, the time
adjustment should still be allowed to be bidirectional.
Casting the offset to an unsigned value after the
subtraction will allow the adjustment to be bidirectional.
Signed-off-by: Tomas Choat <trc@ixys.no>
When sending follow up messages, the pre send function
does not insert the correct time stamp in the message.
Issue is fixed by calling the pre send timestamp function.
Signed-off-by: Tomas Choat <trc@ixys.no>
Fixes the following warning:
<wrn> cbprintf_package: cbprintf_package_convert:
(unsigned) char * used for %p argument. It's recommended
to cast it to void * because it may cause misbehavior in
certain configurations. String:"%s: meta %p len %zu" argument:1
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Update events to use uptime ticks, which is a monotonic clock which
in the same res as kernel ticks. This makes comparisons simple and
removes the complexity of dealing with wrapping counter values.
The wrapping is particularly problematic for events since this makes
it quite complex to track if an event has occured in the past, or
will occur in the future. This info is needed to know if an event
has actually been handled or not.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>