This commit addresses two bugs in use of single timer s/w
switch implementation, incorrect aux_offset in subsequent
ADV_EXT_IND and ISO receiver failing to receive second or
greater BIS subevents.
Fix radio_tmr_start_now implementation to consider the
initial latency in starting the event timer in single timer
use mode. This fixes the incorrect aux_offset in ADV_EXT_IND
PDUs.
Fix radio_tmr_start_us implementation for single timer use,
as the timer is reset on every radio end, and hence the
requested start_us has to be adjusted for the accumulated
last_end_pdu_us value. This fixes the BIS subevent
receptions.
Also, fix the maximum radio ISR latency value used in
radio_tmr_start_us to consider the maximum Rx chain delay
and maximum radio ramp up delays. 80 us + ~30 us + ~40 us
should be able to meet the 150 us tIFS duration.
Relates to commit bcd28e0a86 ("Bluetooth: Controller: Fix
sw switch single timer for spurious TXEN/RXEN").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replaced the k_pipe-based implementation in sockpair with ring_buffer
based implementation instead.
The move to ring_buffer is done to avoid overhead of k_pipe and to align
with the new k_pipe API.
This does not pose any added risk to concurrency as the read and write
functions are protected by semaphores for both spairs.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
In current implementation, the `accept` cannot be identified if the
same one `accept` callback is passed by the upper layer.
Similar with `accept` of `bt_l2cap_server.accept`, add a parameter
`server` to the `bt_rfcomm_server.accept` callback.
Add a argument `server` to function bt_hfp_hf_accept() to avoid
building issue for HFP_HF.
Add a argument `server` to function rfcomm_accept() to avoid building
issue for shell/rfcomm.c.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In the function `bt_rfcomm_server_register()`, the channel cannot be
dynamic allocated. And only pre-set channel is supported.
Improve the function `bt_rfcomm_server_register()` to support the
dynamic channel allocation if the passed channel is zero.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The buffer `BT_RFCOMM_BUF_SIZE` is used to define the TX buffer size of
TX pool.
In current implementation, the TX buffer size of RFCOMM cannot be
calculated due to the macro `BT_RFCOMM_BUF_SIZE` is defined in internal
header file `rfcomm_internal.h`.
Move the macro `BT_RFCOMM_BUF_SIZE` form internal header file
`rfcomm_internal.h` to interface `rfcomm.h`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Log_level command is a duplicate of 'log enable' command from
the logging command set (enabled by CONFIG_LOG_CMDS=y). Adding
warning about deprecation as 'log enable' is recommended since
it has more features (e.g. autocompletion).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
BASE is now parsed on-the-fly on sink sync, removing
unnecessary restriction in intermediate parsed storage
and without requiring an excessive amount of memory.
Signed-off-by: Lars Knudsen <LAKD@demant.com>
add flash_img_get_upload_slot() to get current
upload slot.
when CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD
is enabled, it is not based on the DT.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Content-Range functionality added in recent commits has been propagated
to http_client module. If "Content-Range" string is detected on header
field, Content-Range are returned via http_response structure.
Signed-off-by: Piotr Radecki <piotr.radecki@jrdltd.co.uk>
Content-Range hasn't been supported in zephyr. This change adds
Content-Range header parsing to http_parser module. Range start,
range end, and total size are supported. All units are currently
interpreted as bytes.
This is much needed change, because many applications responsible
for http data download are based on Content-Range approach.
Signed-off-by: Piotr Radecki <piotr.radecki@jrdltd.co.uk>
As the connection was removed from the list, we now own its reference.
Keep this reference and return it to the TX processor.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Assert that the previous connection in the list and the tmp element
in the loop are different to the current connection.
Otherwise, if the same connection was somehow added twice it
could result in an infinite loop.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Iterate over the list of connections to find a connection
that is able to send data, instead of returning NULL if
the first connection can't send data.
This solves the problem with starvation of other connections.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Use a config, instead of hardcode, to set timeout value.
It says how much time UART backend should wait for entire message sent
in chunks.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Instead of setting the upper protocol type in ethernet_send()
by checking the protocol type bits, use the ptype that is already
set by the caller. This allows new protocol types to be supported
and makes the system extensible.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Template string for HTTP 1.0 500 response expects content length as a %d
but was getting passed a 'long unsigned int' instead of an 'int'.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
In case of errors during HTTP2 request processing (or after the HTTP1
upgrade response was sent), send 500 Internal Server Error response
before shutting down the connection.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Since there is a helper function to generate/send headers frame, the
flag can be set there instead of being set separately in various places.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case of internal server errors during HTTP1 request processing,
send 500 Internal Server Error response before shutting down the
connection.
Make sure http1_headers_sent is set whenever sever starts replying, to
avoid duplicate response in case of errors, as that would be protocol
violation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Reply with 405 Method not allowed not only for static FS resource types,
but also for others. Also, the method checking for for static resources
was messed up - those resource types only support GET by design, so no
need to compare resource method bitmask - it should be checked that the
request was actually GET instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
fix coverity issue about deadcode, there is no code path which would
lead to the code that is being deleted with this commit
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Remove unused family variable from receive function in ethernet layer 2.
It is checked only once under such conditions, that do not allow the
variable to be different.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
We can't use 0xff to compare with an int8_t since it'll trigger compiler
warnings/errors:
subsys/bluetooth/host/classic/br.c:397:11: error: result of comparison of
constant 255 with expression of type 'int8_t' (aka 'signed char') is
always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (rssi == 0xff) {
~~ ^ ~~
1 error generated.
Use 127 instead for situations where we don't know the RSSI value, like
when processing remote name events. This is fine since from a spec
perspective only -127 - +20 are valid values for the parameter.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Allow the user to disable the P256-M driver in case their version of
Mbed TLS does not support this driver.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Explicitly enable "PSA_WANT_ALG_ECB_NO_PADDING" to select the AES ECB
mode that it is used in CMAC operation.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
MBEDTLS_AES_ROM_TABLES let Mbed TLS use precomputed AES tables instead
of generating them at runtime and placing in RAM. It clearly helps
reducing the RAM footprint, but at the same time it increases the ROM
one. In order to let the final user decide which kind of optimization
they prefer, we change the "select" statement with "imply".
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
According to MshDFUv1.0, section 6.2.3.5, the Firmware Distribution
Receivers List message is not limited by the size of the receivers list:
```
The number of selected entries shall be limited by the following:
- The number of entries shall not exceed the value of the Entries Limit
field from the Firmware Distribution Receivers Get message.
- The number of entries shall not cause the message payload to exceed
the maximum Access PDU size.
```
Thus, this assertion is incorrect as it doesn't allow to have the
receivers list bigger than number of maximal Access PDU size.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Instead of having 2 separate and non-equal checks for
capabilities in ASCS and the Broadcast Sink, there is now
a single function in pacs.c that performs the
check.
This reduces code size and makes it easier to maintain.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix incorrect nbytes_to_read calculation in ext2_inode_read() function.
Previously nbytes_to_read was decremented by read value which caused
incorrect calculation of bytes to read in subsequent iterations.
Now nbytes_to_read is decremented by to_read value which represents
the actual number of bytes read in current iteration.
This fixes potential data corruption issues when reading files from
ext2 filesystem.
Signed-off-by: Chen Shu <751541594@qq.com>
Ensure all pending log messages are processed by the log processing
thread when log_flush is called, blocking the caller until done.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Move the contents of Kconfig.iso to the common Kconfig
file.
The main reason for this is that the Kconfig.iso filename
has caused issues for some, due to the .iso filename extension.
The contents have been moved to right after the Kconfig options
for BT_CONN which are quite similar.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
libmctp provides interfaces for wiring up a MCTP bus it calls bus
bindings. The bindings provided in libmctp however are not directly
useful to Zephyr without some work. Provide an initial uart binding that
directly uses Zephyr's async uart interface.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Fixup payload_index to be uint16_t to avoid index overflow.
Do not remember why ptc is 4 bits, where as it must be 5 bit
value similar to nse; added an assertion check until it is
fixed.
Fix ISO Broadcaster and ISO Sync Receiver for PTO > 1 and
use of Pre-Transmission Group Counts.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add back the implementation in the Controller that tries to
enable pre-transmissions to improve time diversity to aid a
remote ISO Sync Receiver role device.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For pre-transmission groups > 1, the broadcaster link layer would fetch
incorrect payloads from the TX node queue.
Update payload index calculation to reference correct TX payload. Fix
PTO FIXMEs and range checks.
Signed-off-by: Morten Priess <mtpr@oticon.com>
* Move all KConfig configuration from CMake to `nrfx_kconfig.h`
* Move macro utils from `nrfx_kconfig.h` to `nrfx_zephyr_utils.h`
* Move GRTC channels allocation from `nrfx_kconfig.h` to
`nrfx_reserved_resources.h`
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
Commit:
- adds dependency of the mbedtls psa usage on secure storage
- removes PSA ITS emulator and enables usage of
the secure storage in ble mesh bsim tests
- enables secure storage in all ble mesh and related samples
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This commit removes the `ctx_shell` declaration from the Bluetooth shell,
marking a milestone in eliminating this dependency.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `classic/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `mesh/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `audio/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>