Fix Extended Advertising Data population when there is no
Extended Header to be filled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
.../ll_sw/nordic/lll/lll_scan.c: In function 'isr_tx':
.../ll_sw/nordic/lll/lll_scan.c:483:19: error: unused variable 'lll'
[-Werror=unused-variable]
483 | struct lll_scan *lll = param;
| ^~~
cc1: all warnings being treated as errors
This fixes https://github.com/zephyrproject-rtos/zephyr/issues/29968.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Since the tracing of thread being switched in/out has the same
instrumentation points, we can roll the tracing function calls
into the one for thread stats gathering functions.
This avoids duplicating code to call another function.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
We should not be initializing/starting/stoping timing functions
multiple times. So this changes how the timing functions are
structured to allow only one initialization, only start when
stopped, and only stop when started.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If rand32_xoroshiro128::z_impl_sys_rand_get is called with outlen
not divisible by 4, it will overflow the dst buffer. This happens
because blocksize is not changed from 4 to the difference between
outlen and len. If outlen is < 4, z_impl_sys_rand_get will be stuck
in an infinite loop that keeps writing random bytes outside the buffer.
If outlen is > 4, z_impl_sys_rand_get returns after the correct number
of loops, but it writes every byte to the buffer, not just outlen number
of bytes. This causes the buffer to be overflowed with up to and
including 3 bytes.
Signed-off-by: Didrik Rokhaug <didrik.rokhaug@gmail.com>
Since ADV_EXT_IND is received on primary channel, the AR is configured
to resolve AdvA in legacy PDU (assuming on 1M) and it will not resolve
AdvA properly. In such case, we should resolve AdvA manually in LLL.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This allows to synchronously resolve any address using AAR. The AAR
has to be configured prior to calling this function.
The intended use for this function is to resolve AdvA in a PDU on
primary channel when AR was configured for different PDU type. That
means AR was configured to resolve in legacy PDU, but extended PDU
was received and we need to resolve AdvA manually. In such case, AAR
is already configured so just need to trigger it again with proper
ADDRPTR.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This patch allows to configure AR for resolving AdvA in extended adv
PDUs. The extra 'flags' field provides a hint from caller on how to
setup AR:
- if legacy PDU is expected, AdvA is set after PDU header,
- if extended PDU is expected, AdvA is set with +2B offset due to
common extended advertising header,
- if Coded PHY is used, AdvA is set with extra +5b offset due to CI and
TERM1 fields.
Note that AUX_SCAN_REQ and AUX_CONNECT_REQ are also considered legacy
PDUs here since they are exactly the same as SCAN_REQ and CONNECT_IND.
If neither legacy nor extended PDU is specified, it's derived from PHY,
i.e. 1M means legacy, non-1M means extended. Since it is still possible
to receive different type PDU in such case, it's up to LLL to detect
this and resolve AdvA when RX is done.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Instead of guarding the NODE_RX_TYPE_USER cases with
CONFIG_BT_CTLR_USER_EXT we guard them with
CONFIG_BT_CTLR_USER_EVT_RANGE > 0 as that is the actual value that
enables/disables the NODE_RX_TYPE_USER values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of having explicit values for each entry in the enum that
has to be updated for each new entry (thus requiring manual work
which can also be error-prone), the enum will now be
self-incrementing, to make it easier and safer to add new
entries.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the #ifdef's for the node_rx_type enum. Since the
savings, they just make the enum harder to read.
Furthermore it will also ensure that all the enum values
will have the same value once the enum entries are no
longer manually defined.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
lll->conn is only defined valid when BT_CENTRAL is enabled.
Also ull_sched_mfy_after_mstr_offset_get is only used when BT_CENTRAL
is enabled.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Adds check for TTL max in the transport send functions, and moves
setting of default TTL to transport.
Fixes#29855.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Change the advertising option that controls if the directed advertiser
will use an RPA or the identity address of the peer for the initiator
address.
This option currently has two issues:
- It behaves differently if the privacy feature has been enabled,
which can be confusing for application to use.
- It cannot start a directed advertiser towards a peer that is not
privacy-enabled and has distributed an IRK.
This commit includes the following changes:
- When privacy has been enabled in order to advertise towards a
privacy-enabled peer the BT_LE_ADV_OPT_DIR_ADDR_RPA option must now
be set (same as when privacy has been disabled).
- It is now possible to start a directed advertiser using the identity
address of the peer when privacy-enabled.
- When privacy has been enabled the advertising option combination
of using the local identity address and an RPA as the initiator
address is now disallowed and will return an error code.
This is done because this combination did not actually work and would
have used the identity address of the peer instead.
- If the controller does not support controller-based privacy then
using the option BT_LE_ADV_OPT_DIR_ADDR_RPA will return ENOTSUP
because this behavior cannot be done with host-based privacy.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Host can discard scan response data by setting empty data. We simply
set PDU length to 0 to indicate this, it will make future check easier.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Align the PDU buffer reference in struct node_rx_pdu so that
node rx type specific parameters, like, terminate and sync
lost reason can be accessed without any memory alignment
issues.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This configuration is be required to enable the shell management
command handler supported by the core mcumgr library
Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
Fix maximum Advertising Channel PDU payload size calculation
by including the Common Extended Advertising Payload Format
overload alongwith the AD data maximum size supported.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation using mfifo to return stale AD data PDU
from LLL to Thread context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Kconfig option to configure maximum number of buffered
AD data PDUs across enabled advertising sets.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This is a step towards phasing out DEVICE_INIT and just having
DEVICE_DEFINE. To make it a little easier on users or DEVICE_DEFINE
if they don't care about PM, they can just pass NULL for the
pm_control_fn paramater.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Put infrastructure for the following HCI commands/events in place:
* LE Set CIG Parameters command
* LE Remove CIG command
* LE Create CIS command
* LE Accept CIS Request command
* LE Reject CIS Request command
* LE CIS Established event
* LE CIS Request event
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
Adds a `destroy` callback to the `struct bt_gatt_indicate_params` which
is used to signify to the application that the indication operation has
completed and the struct instance can be freed/destroyed.
This is required as the number of indication value callbacks that will
be triggered is not known by the caller when the `conn` parameter is
`NULL`.
Tracking when this callback should be run is mananged by a private
reference counter inside the struct.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Update the signature of the `bt_gatt_indicate_func_t` callback type by
replacing the attr pointer with a pointer to the
`bt_gatt_indicate_params` struct that was used to start the indication.
This allows the callback to free the `bt_gatt_indicate_params` instance
if it was allocated from storage, while still allowing the
`bt_gatt_attr` value to be accessed through `params->attr`.
Allocating the `bt_gatt_indicate_params` instance from storage is
desirable as multiple indications can be queued, however each instance
must be valid until the callback is run.
Implements API update from #29357
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This change enables support for DNS service discovery
(RFC 6763) in the mdns_responder service and sample app.
Fixes#29429
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds support for DNS Service Discovery (DNS-SD)
as described in RFC 6763.
Fixes#29099
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
This change adds net_context_port_in_use(), which is a simple
wrapper around net_context_check_port() and is used to check
if a particular socket is bound to a given IP address.
Fixes#29649
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Allow application to enable L2CAP dynamic channels without support
for Enhanced Credit Based Flow Control (CBFC).
Since these are separate features in the qualification it should
be possible to qualify L2CAP connection oriented channels without
also having to qualify L2CAP enhanced credit based flow control.
The L2CAP/LE/REJ/BI-02-C conformance test will fail when enhanced CBFC
has not been selected in the ICS.
The lower tester expects that since the Enhanced CBFC is not supported,
the command L2CAP_CREDIT_BASED_CONNECTION_REQ should be met with an
L2CAP_COMMAND_REJECT_RSP and not an L2CAP_CREDIT_BASED_CONNECTION_RSP.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Moves mesh feature configuration to a separate module, deprecating the
bt_mesh_cfg_srv structure. The initial values for the features should
now be enabled through KConfig, where new config entries have been added
for each feature.
This removes the upward dependency on the config server from the core
stack, and makes the config server a pure frontend for the configuration
states, as all spec mandated behavior around the feature states is now
encapsulated.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Encapsulates the Heartbeat state and functionality in a separate
heartbeat module, removing all manipulation of the heartbeat state from
the transport and config server modules.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>