Add a selection of interval values that are suitable for BAP,
which will allow better coexistence between ISO and ACL,
for both broadcast and unicast. Some of these are defined
by the BAP spec, and some are defined by Zephyr, since they
do have a suggested value from BAP.
Samples and tests have been updated to use these new values.
Peripheral samples have also been updated with
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS so that the connection
parameters from the centrals aren't updated to something else
shortly after.
The shell has also been updated to use the LE Audio (BAP) values
if audio is enabled, and the audio.conf file has disabled automatic
updating of the connection parameters as the peripheral, as we rarely
(if ever) want to do that.
Due to the connection interval change, CI hit an issue
with test_bass_broadcast_code in test_main_client_sync, where
the reading of the long receive state did not finish before we
attempted to do another procedure, so the function was updated to have
a retry.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In current implementation, the SDP discovery complete event is not
notified when the response data length is 0.
Notify the discovery complete event if the response length is 0.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Fix mistake in host implementation of Advertising Coding Selection.
The host should only try set the BT_LE_FEAT_BIT_ADV_CODING_SEL_HOST
when the observer role is enabled. If a broadcaster enables the
CONFIG_BT_EXT_ADV_CODING_SELECTION Kconfig option bluetooth will
fail to initialise.
Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
The pending discovery request will not be handled in some cases.
The cases include,
- The received data length is not aligned with frame length
- The continuation status length is more than maximum value
- Total length of the response is less than the frame length
- Unknown operation code is received
There is also a case where the current discovery result was not
notified when processing the pending discovery request.
The cases include,
- Fail to send SDP request
- No tail room of received buffer to save the response data
Fix the issue by using the following steps,
- Notify the application that the discovery is done
- Process the pending discovery request
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
If the remote is in bondable mode, but the local is in non-bondable
mode, the local host shall respond to an IO capability request with
a negative response.
In current implementation, it does not check the bonding flags of the
both sides are consistent.
Fix the issue by checking the consistency of bonding flags of the both
sides. If they are not consistent, send a negative IO capability
response with the reason pairing not allowed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The `conn` is found by using function `bt_conn_lookup_addr_br()`, it
should be released by calling `bt_conn_unref()`. But `bt_conn_unref()`
is missing in the case that the pairing is not accepted.
Release the `conn` by calling `bt_conn_unref()` before exiting the
function `bt_hci_io_capa_req`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add fields `total_len` and `recv_len` to `struct bt_sdp_client`.
Save the total length of the response to `total_len`.
Save the received data length of the response to the `recv_len`.
Check the consistency between `total_len` and `recv_len` after all of
the response packets are received.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Split the fuse FS driver into 2 parts: A top built in the embedded side,
with the embedded libC, and a bottom built in the runner side with the
host libC.
The error returns are converted to match the host libC.
Also, before the host FUSE thread, which is asynchronous to Zephyr was
calling directly into the Zephyr filesystem code, which resulted quite
often if catastrophic failures or corruption of the Zephyr state.
This is now fixed by having the FUSE thread queue requests to a Zephyr
thread, which will be handled in the embedded side in a coherent way.
This adds a slightly noticeable overhead, but the performance is still
acceptable.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The ISO configs set defaults based upon BT_ISO_MAX_CHAN and other
configs defined in `bluetooth/Kconfig.iso`.
By adding these dependencies the error messages resulting from
adding `CONFIG_BT_CTLR_PERIPHERAL_ISO=y` to a project configuration
file will become less confusing.
Now the build will output:
```
warning: BT_CTLR_PERIPHERAL_ISO (
defined at subsys/bluetooth/controller/Kconfig:976,
subsys/bluetooth/controller/Kconfig:984) was assigned the value 'y' but
got the value 'n'. See ...
```
Previously we would get:
```
warning: default value 0 on BT_CTLR_CONN_ISO_STREAMS
(defined at subsys/bluetooth/controller/Kconfig:993)
clamped to 1 due to being outside the active range ([1, 64])
```
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
If mDNS resolver is enabled but mDNS responder is not, then
mDNS multicast address group is not joined. This would prevent
the mDNS resolver to receive the responses. Fix this by
joining the mDNS multicast group if mDNS responder is not
enabled (because the responder will join the group itself).
Fixes#86477
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
There is a deadlock issue when calling stop using address conflict
detection. This is due to the fact that some net_mgmt events are fired
and trigger the dhcpv4_acd_event_handler() with lock held even if they
are of no interest for this callback.
Therefore, before acquiring the lock, make sure the event we received
is one we are expecting.
Also, do the same for dhcpv4_iface_event_handler().
Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
The logging thread is usually woken up by a timer, if the timer
period is longer than 10ms, log_flush() can iterate multiple times
needlessly, while waiting for the next timer. Instead wake up the
logging thread to let it flush the queue immediately. Besides a
hard-coded polling period of 10ms is too long for some applications,
make it a Kconfig parameter.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add compression support using the accept-encoding
header to the http server static filesystem resource.
Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
The response should not be handled if there is not a request has been
sent.
Ignore the response if the `session->param` is `NULL`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In current implementation, if the UUID of request is unknown, the
local variable `u` will not be updated, and the unknown UUID `u`
is used as the target to search it in the SDP record list. It may
result in irrelevant record being replied to the requester.
Ignore the unsupported UUID to fix the issue.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
http_server_http2.c does not guard check if file system is available
or not before using file system api. This PR will add guard for that
Signed-off-by: bac phan <phanhaibac98@gmail.com>
When the continuation length is not 0, there is a reported error.
In current implementation, the total length is only valid only when
the frame is the first block of the SDP response. For following
continuous frame, the total length is 0.
So, change the condition to `(total != 0 && frame_len > total)`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Rename this driver to eth_native_tap, including renaming all its
options.
The old options remain until v4.4, but as deprecated.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The CONFIG_POSIX_C_LIB_EXT will get support for fnmatch() function.
The old CONFIG_FNMATCH is deprecated.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Update Kconfig to not select BT_TICKER_REMAINDER_SUPPORT for nrf54L
Add BSim tests to cover using a ticker without BT_TICKER_REMAINDER_SUPPORT
and expire info enabled
Signed-off-by: Troels Nilsson <trnn@demant.com>
A few things were not flagged by CONFIG_BT_TICKER_REMAINDER_SUPPORT
that should have been; This caused building without it to fail
Initialize remainder to 0 where used with ticker_next_slot_get_ext(),
since it may not get set if remainder support is off
Signed-off-by: Troels Nilsson <trnn@demant.com>
When we receive piggybacked Ack, it means that we have
received all information for this request.
There is no need to track exchange lifetime anymore.
Once we reset the internal request, it is free to be used
for the application. So if we only have few requests allocated,
it would be slow to send those as get_free_request() only
gives request structures that don't have a lifetime left.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
As to facilitate work items preemption, common for sensor read ops.
e.g:
- Sensor read (submitted through workqueue).
- SPI read (submitted through workqueue using default handler).
This requires at least 2 thread pools to allow SPI read to complete,
to then come back and complete sensor reading.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
In `db_hash_setup()` the state object for MAC operations was initialized
using `psa_mac_operation_init()`. This function was not always optimized
or inlined.
A way to reduce stack usage is to use `memset()` and set the object to
0. This is one of the option documented to initialize
`psa_mac_operation_t` object.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
- Add possibility to choose implementation of OpenThread L2 and
set it to Zephyr's by default
- Remove unused `OPENTHREAD_SECURITY_INTERNAL` Kconfig
- Add missing choice names for logging and coprocessor
Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
Use the newly added timeout in various send functions from within
net_context_sendto.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Allows to send with different timeouts to not block caller in some
situations. Stable API is kept and just calls `try`-variant with a timeout
of `K_FOREVER`.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Use the recently added bt_le_get_local_features function as well
as bt_conn_get_remote_info to avoid using internal APIs to
check for PAST supported.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The connection object is, and should not, be modified by the function.
Making it const makes it possible to do this simple operation
in functions that also won't change the conn object (i.e.
that uses `const`).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The function supports reading multiple controller-based values.
It is effectively a copy of struct bt_dev_le but in a more
application-oriented definition.
It was chosen to keep the features as an array rather than a
64-bit value, as the comparison macros work on arrays and that
there already exists new bits > 64 in the core spec which is not
yet supported by Zephyr.
It is being smoke tested in a generic GATT client test,
as the individual values may depend on several Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The coap_client has a static/internal function, has_ongoing_exchange(),
which can be an useful addition to the public API. This would provide
a mechanism to determine when it is safe to close a socket gracefully.
Signed-off-by: Povilas Selevicius <povilas.selevicius@quadigi.com>
Bugfix previous `osThreadJoin()` implementation where a thread which
exited with `osThreadExit()` could not be joined upon by other threads.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
Add a variant of the SNTP API that does not block while waiting for a
response from the SNTP server. Instead it takes advantage of
`CONFIG_NET_SOCKETS_SERVICE` to read the response asynchronously when
the response is received.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Extract the SNTP query send logic out of `sntp_query` so that it can be
used by functions that don't synchronously wait for the response.
Signed-off-by: Jordan Yates <jordan@embeint.com>
When a TCP connection is refused during zsock_connect, errno is set
to -ENOTCONN, but errno should be set to -ECONNREFUSED. This change
causes the ECONNREFUSED status to be propagated from tcp_in to
net_tcp_connect, which eventually causes errno to be set
to -ECONNREFUSED.
Signed-off-by: Noah Olson <noah@wavelynx.com>
In order to support new toolchains that are not compatible with
gcc/clang (e.g., IAR), we need to add a level of indirection for
the name of warnings.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Add a Kconfig BT_LIMITED_DISCOVERABLE_DURATION to set the timeout for
limited discoverable mode.
Add a argument `limited` to function `bt_br_set_discoverable()` to
support the limited discoverable mode.
When enabling discoverable mode with `limited` is true, both write
LIAC and GIAC to controller and set the bit 13 of COD in function
`bt_br_set_discoverable()`. And start a delay worker with the timeout
CONFIG_BT_LIMITED_DISCOVERABLE_DURATION to disable the discoverable
mode.
When disabling discoverable mode, only set GIAC to controller and
clear bit 13 of COD.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
if saving buf to another variable, usually the ref/unref
needs to be used. change to pass the buf as one parameter
of callback
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
memset already clean the `buf`, don't need to set as NULL.
`avdtp_set_status` already set `req->status` based on `msg_type`,
don't need to check `msg_type` again.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
bt_a2dp_ep_info is used in bt_a2dp_discover, and the max
discovered endpoints' info are already given in seps_info
of bt_a2dp_discover_param, so use pointer to point to the
seps_info of bt_a2dp_discover_param.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>