For composite operations, we should always check whether the TLV header
is present. Otherwise, all blocks are assigned to one resource.
Signed-off-by: Simon Walz <simon.walz@autosen.com>
The Block1 context for composite operations is not found, as all path
levels are compared. The incoming path level should therefore always be
taken into account.
Signed-off-by: Simon Walz <simon.walz@autosen.com>
Adds an optional hook that allows for appending additional
responses to the bootloader info command
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When using sendmsg() and if CONFIG_NET_IPV4_MAPPING_TO_IPV6 is
enabled, then the addr4 variable was set too late which was causing
null pointer access.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Removed deprecated native_posix as test platform.
Added unique sim_ids for tests with the psa as a overlay.
Fixed clang-format issues.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
When a message with invalid parameters is received, we must ignore it.
In this commit we check invalid parameters first.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
If use `IS_ENABLED` macro inside if statements but not as preprocessor
directives, we can always compile the code for settings even if settings
are not used. This allows to reduce amount of firmwares we need to build
in CI to ensure that code compiles.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
We must tcheck if buf has enough tailroom to fit another pair of keys or
pair addresses with direction.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
If relay feature doesn't have own adv set, it should use the main adv
set to send messages.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
When a synchronous API is used, the content of `buf` will not be
valid by the time the thread that called the synchronous API is woken up
again.
Therefore, the simplest way to solve this is when a user allocates the
buffer which will be filled up with the content of the buffer passed to
the model callback.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
When relaying a Network PDU to another subnet, we need to update sub
field of rx structure so that correct credentials are used. We also need
to update NID field of the Network PDU.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The initial implementation of RPL check for Subnet Bridge wasn't fully
correct. It decides whether to relay or not a PDU based on RPL of only
received messages. However, the spec section 3.9.8 says:
```
In addition, a Subnet Bridge node shall implement replay protection for
all Access and Transport Control messages that are sent to bridged
subnets.
A Subnet Bridge node shall maintain the most recent IVISeq value for
each source address authorized to send messages to bridged subnets.
Messages received by the Subnet Bridge node with the IVISeq value less
than or equal to the last stored value from that source address shall
be discarded immediately upon reception. When a message is retransmitted
to a bridged subnet, the stored IVISeq value shall be updated. In this
way, bridged subnets are protected against replay attacks from other
subnets.
```
This was noticed with MESH/NODE/SBR/NET/BV-02-C test. It passes when
PTS misses the message at step 3 and 4, and fails when PTS manages to
receive the message.
This commit fixes the wrong behavior by removing argument for
`bt_mesh_rpl_check` function making store a new message and bypassing
`local_match` check in case of Subnet Bridge node.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Though nvs backend checks whether the data passed to it is identical to
the stored one, this isn't guaranteed by other the settings api. We can
also avoid going into the settings subsystem since we know what was
actually changed.
This commit adds 2 flags that allow to control whether Subnet Bridge
or Bridging Table states were changed and skips storing if the certain
state was not changed.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
We store only filled up entries, but want to restore the entire table.
`bt_mesh_setting_set` fails if the restored length didn't match the
provided length.
This commit fixes the restoring of the bridging table by allowing to
restore any size as long as the stored size is less than the allocated
one and it is a multiple of the size of a single entry.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Adds subnet bridging functionality to the network layer.
Also fixes brg_cfg_srv for minor issues to get it working.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Adds implementation for the Bridge Configuration Server model.
Updates `brg_cfg` module to add sanity check for
bt_mesh_brg_cfg_tbl_remove() API. Also, updates the unit test
accordingly.
Adds documentation for the Bridge Configuration Server model
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Implements the Bridge Configuration Client model.
Adds opcodes for all Bridge messages to `foundation.h`. Adds client-side
support for these messages.
Adds a new Kconfig option for the Bridge Configuration Client model to
configure the waiting time for respones for acked messages.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
The `brg_cfg` module implements the states needed for subnet bridge
feature. It provides two states - enable state, and bridging table
state. APIs are provided to access and modify the states. The module
handles responsibility of persistence of the states.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
Adding documentation and function calles for the API's
in Bridge Configuration Client model and Bridge
Configuration Server model.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Any places that checked for GTBS is now always enabled
as GTBS is mandatory to support, and the Kconfig option
was removed.
Also removed a duplicate Kconfig option for TBS,
BT_TBS_SERVICE_COUNT, as it was unused.
The other Kconfig option BT_TBS_BEARER_COUNT is used
instead exclusively to set it if needed.
Since GTBS can now exist alone, it must also
support having its own calls and other values.
This means that the GTBS and TBS instances now share
the same underlying struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace the busy boolean flag with an atomic value.
This prevents any race conditions with the MPL implementation.
Modifies where the new atomic value is set and cleared
so that initialization gets to finish before allowing
any reads.
Due to how the MPL is structured, and how a select cannot
be rejected from OTS, this does not give a perfect solution.
Ideally we need a separate object per OTS object, rather than
a shared one, and/or the OTS implemenation would allow
us to reject a select if the object is not currently
available or ready.
This commit does not fix the above issues, as that is a
larger undertaking.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Aligns the logging unhandled vs events with the regular ones.
Now it prints out the code and length.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
There's no reason for the .exported_sym data to always land at one end of a
data region; the order of sections depends on the whim of the compiler and
assembler.
Ignore overlaps between that region and other data regions.
Signed-off-by: Keith Packard <keithp@keithp.com>
GCC complains about struct sockaddr accesses due to the various
address-family-specific variants being of differing sizes. Let's not
mess with code (which looks correct), just silence the compiler.
Signed-off-by: Keith Packard <keithp@keithp.com>
Use a new file and command for this where all CS commands
can live.
Added support for bt_cs_set_default_settings command.
Added test case where shell is built with CS to ensure code
is built in CI.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Added support for a new API for setting default channel
sounding settings, this is mainly a wrapper around the HCI
command.
For this add a new module for channel sounding, where new
channel sounding APIs will go.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Define a macro to validate aux offset value as it is checked
both in LLL and ULL execution contexts.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Controller hang due to infinite looping caused by
duplicate node_rx enqueued in auxiliary context.
When LLL scheduling is not applied due to invalid aux offset
then ULL scheduling too would skip setting up the reception
after similarly checking the validity of aux offset required
to schedule the reception of auxiliary PDU. This check in
ULL was after the received node_rx being enqueued into the
auxiliary context causing a loop in the list of node_rx.
Dequeue of a list with a loop of node_rx caused an infinite
loop execution in the Controller.
Regression introduced in commit 3590bd648f ("Bluetooth:
Controller: Fix missing invalid aux offset check").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add assertion check to catch infinite loop due to incorrect
node_rx release.
If same node_rx is released twice then it can lead to
infinite looping when releaseing link or node_rx buffers.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace the booleans used by the VOCS client to use
an atomic value instead.
The flags are modified to be used in a way that prevents
race conditions.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We do not need promiscuous mode setting in host side when testing
bridging with native-sim, so just ignore errors in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add callbacks for setting and getting the sample rate. The callbacks are
optional if all Clock Source entities support only one sample rate.
This commit results in working High-Speed operation with Windows UAC2
driver when the Clock Source is host-programmable. Windows UAC2 driver
won't work if setting sample rate fails even if Clock Source supports
only one sample rate.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Queue explicit feedback write once the previous one finishes in order to
make it possible to cope with 8x faster High-Speed pace. This matches
the originally intended behavior described in comment.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Generate Full-Speed and High-Speed descriptors based on full-speed and
high-speed instance properties. Use appropriate descriptor set based on
active speed.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
There is an issue on the SHI hardware peripheral to detect CS
rising/failing with bits CSnFE/CSnRE in the EVSTAT2 register in
npcx9m7fb chip. This commit workarounds it by using MIWU to detect the
CS rising and failing.
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
According to Mbed TLS changelog this feature was set default ON
since 3.1.0 release, so the build symbol is no more available.
This commit removes it from Zephyr.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Replace the boolean values for the BAP Broadcast Assistant
with an atomic value. This prevents a rare, but possible,
race condition.
The busy flag has been replaced with 3 atomic values which
provide better granularity in error handling, and allows for
some concurrent write and read requests.
To describe the new behavior, the return values in the documentation
has been updated, and the error handling in the API
functions has improved.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a bool fn so there is some room for a comment explaining why this is
not guarded by an IS_ENABLED().
Also add an optimization when building with an onboard controller.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The code was a bit hard to read. From what I understood, the intent is
to not send the PHY update if we are already on 2M symmetric.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>