New API for suspend and resume LwM2M engine.
New event LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED for indicate
application that engine is suspended.
Simplify stack suspend and resume state same time for queue mode.
New CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE for enable skip socket
close at RX_OFF_IDDLE state that socket is only suspended and close is
called only when connection is resumed.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
A test case may invoke run_all multiple times, causing
logic for listing tests to run tests on second call.
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
Scanner was disabled after Friend Clear command. LNP didn't have
chance to receive Friend Clear Confirmation command back.
If option BT_MESH_LPN_ESTABLISHMENT is off then scanner is left
disabled and next Friend Offer after Friend Request
cannot be received.
PR fixes this.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Direction finding functionality does antenna switching during CTE
reception in AoA mode and CTE transmission in AoD mode. Antennas are
switched according to user provided antenna switch pattern. If a CTE
length is enough to exhaust all antenna ids in a switch pattern then
Radio should loopback to reference antenna and continue from switching
from it.
Current implementation loops back to wrong antenna due to wrong index
used in GUARD_REF_ANTENNA_PATTERN_IDX. It was set to one instead of
zero. Zero is the index of reference antenna in Host provided antenna
switching pattern array.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Added define PDU_AC_EXT_AD_DATA_LEN_MAX, maximum AD data
length possible in AUX_ADV_IND when all Common Extended
Header Format fields are populuted.
Updated function description to explain the added ADI and
Aux Ptr fields support in updating the auxiliary PDUs.
Remove the redundant CTE info population code unnecessary
for new chain PDU as a result of AD data overflow.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use minimal time reservation for auxiliary and sync PDU
reception. A peer device could be scheduling multiple
advertising sets in a short duration with small PDUs hence
using the minimal time reservation would avoid skipping
closely scheduled reception of multiple auxiliary PDUs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor DF implementation to add aux offset in the aux
pointer field of the parent PDU when chain PDU is added
and/or is duplicated when PDU contents are updated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation to support Extended Scan Response Data
fragment operation of first, intermediate, last, unchanged
and complete data operation using the HCI LE Set Extended
Scan Response Data Command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Minor refactor of scan response implementation to rename sr_pdu
to sr_pdu_prev, and aux_pdu to sec_pdu_prev etc.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation to support Extended Advertising AD Data
fragment operation of first, intermediate, last, unchanged
and complete AD data operation using the HCI LE Set Extended
Advertising Data Command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Rename Kconfig BT_CTLR_ADV_PDU_BACK2BACK to
BT_CTLR_ADV_AUX_PDU_BACK2BACK to represent use of
back-to-back for Extended Advertising PDU chaining support
similar to BT_CTLR_ADV_SYNC_PDU_BACK2BACK that is used to
represent the use of back-to-back for Periodic Advertising
PDU chaining support.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ull_adv_sync_pdu_set_clear() to return aux_ptr
reference so that aux_ptr field for chain PDUs can be
pupulated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor PDU chaining implementation to add aux offset in
the aux pointer field in the parent PDU when duplicating
chain PDUs.
By adding the aux offsets in the ULL execution context the
LLL prepare execution in Extended and Periodic Advertising
does not need to have a O(n) while loop in LLL execution
context.
This will reduce CPU use in the highest priority ISR
compared to current implementation where chain PDUs where
duplicated in ULL execution context and aux offset populated
in LLL execution context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Cleanup Periodic Advertising Chain PDUs auxiliary pointer
population, populate the back to back auxiliary pointer
field in thread context. Also, removed an unused code for
filling data.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the ull_adv_aux_hdr_set_clear function so that the
caller of the function will enqueue the auxiliary PDU when
enqueuing the primary PDU.
This change is required to support chaining of AD Data where
parent auxiliary PDU will be added with aux ptr fields when
chain PDUs are appended.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Periodic Advertising Synchronization from being
preempted by an overlapping Auxiliary PDU scan event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix skipped Periodic Advertising Sync radio events due to
increased CPU use during pre-emption in LLL from a Scan
radio event to Periodic Advertising Sync radio event by
increasing EVENT_OVERHEAD_START_US value.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix to prevent a transmitted CONNECT_REQ PDU from being
aborted mid-air when initiator is using continuous scan
window that do not use time reservation. A different state
or role that overlaps the connection initiation requesting
for an abort should be denied when CONNECT_REQ PDU has been
enqueued for tranmission by the radio.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When directed advertising and continuous scanning are
simultaneously active, and a connection request is received
by the directed advertising state then the connection was
not established due to the done event not being generated.
Done event from the directed advertising state was not
generated because the prepare pipeline only had resume
event which does not get scheduled when there is prepare
event of the continuous scan state.
The fix is to explicitly abort all pending prepare and
resume event in the pipeline for the directed advertising
state when connection request is received.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Make the option TEST_EXTRA_STACK_SIZE depend on Tests, otherwise it will
appear in each generated .config file.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This config option is only used with ztest, so move it under ztest.
Otherwise it appears in .config when you build ANY application.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Current API allowed to get notified when the maximum system latency
changes, however, a single callback was allowed. The design was intended
for SoC specific actions when latency changes. However, in some cases
drivers may also want to know the current maximum latency to perform
local actions if other parts of the system modify it.
This patch updates the API with a pair of subscribe/unsubscribe calls to
achieve such goal. Tests have been updated to show how the API can be
used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
When new latency requirements are introduced/updated, the microseconds
value gets converted down to ticks. Ticks usually have a coarse
resolution compared to the microseconds scale. This is fine for making
PM state change decisions, however, when getting notified about latency
changes, we may want to know the real value in microseconds, even if the
system rounds to ticks internally. This patch stores the value in both
us and ticks (in ticks to cache the conversion, really), so that the
user will get notified with precise latency values.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Network connection was not unregistered properly for packet socket,
which resulted in dangling connection when net_context was dereferenced
(i. e. when packet socket was closed). This could lead to a crash on a
consecutive incoming packet.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Nordic Radio Direction Finding Extension provides 12 bits wide IQ
samples. The Bluetooth Core Specification 5.3 Vol 4, Part E sections
7.7.65.21 and 7.7.65.22 limits IQ samples to be 8 bits wide.
There are other way to convert 12 bits IQ samples into Bluetooth Core
specification compliant 8 bits IQ samples than ordinary 4 bits right
shift. If one is sure that samples will never go over 10 bits or 8
bits then, it is allowed to use 2 bits right shift or even 8 least
significant bits of 12 bits IQ samples.
The commit introduces a possibility to choose which approach is used
for IQ samples conversion in HCI layer while Host IQ report events
are created.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add the "zephyr/" prefix to various #include statements that are
preventing the CI form running with LEGACY_INCLUDE_PATH=n.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Added API function +int settings_storage_get(void **storage)
which allows to get storage instance used by the
settings backed to store its records.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Boolean options are not allowed to start with "Enable...".
BT_HCI_VS_FATAL_ERROR started with "Enable..." making some PRs fail due
to compliance checks.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Provide common helper functions to create extended extended Zephyr
Fatal Error functionality in HCI common code.
Use the implementation in hci_rpmsg sample.
The sample didn't provide an information about Controllers assert
or system fatal error to an application code while run with nRF5340
SoC. The goal for hci_rpmsg sample change is to enhance user experience
for conformance testing of the Bluetooth Controller while executed with
nRF5340.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Review rework of the fix to remove the jitter in aux offset
and sync offset values.
Force select BT_TICKER_REMAINDER_GET and BT_TICKER_LAZY_GET
features when Extended Advertising and Periodic Advertising
is supported.
Rename ticks and microsecond offset value struct members
for primary PDU event offset (to auxiliary PDU event).
Converted HAL_TICKER_REMOVE_JITTER and HAL_TICKER_ADD_JITTER
macro to functions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use remainder value in scheduling the periodic auxiliary
PDUs and use the ticker next slot get interface with
remainder value to fill the auxiliary offsets with
microsecond precision in the primary channel PDUs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Updated ticker implementation to return remainder value for
a ticker when enumerating active tickers with time
reservations.
This is required to find offsets and to use the remainder
value to correctly calculate auxiliary offsets to the
microsecond resolution.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix overlapping 1M and Coded PHY scanning that caused idle
radio time when both PHY use same scan interval and sum of
their scan window duration equals the interval.
Implementation now will use continuous scanning and offset
the start of Coded PHY by the window duration of the 1M
scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The initialisation of DLE parameters for the peripheral
was done before the intialisation of the PHY settings.
Since the DLE parameters depend on PHY settings this
can result in incorrect parameters for tx/rx time and
octets
One scenario is where a previous connection set the PHY to
2M or CODED, then when a new connection is established
it uses the same memory-locations for connection settings as the
previous connection, and the (uninitialised) PHY settings will be
set to 2M or CODED, and thus the DLE parameters will be wrong
This PR moves the initialisation of DLE parameters after
that of PHY settings
EBQ tests effected include LL/CON/PER/BV-77-C.
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Now that we properly destroy the tx context in `bt_conn_process_tx`, we
need to make sure the context is really valid.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Symptoms were that a disconnect happening when a buffer was enqueued but
not sent resulted in a meta-data memory leak.
This is problematic because it seemed (as per the OP) that it resulted in
the whole host getting locked up when a device sending long L2CAP packets
was prone to disconnect-reconnect cycles (e.g. in a bad RF environment).
Fixes#47649
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Code was limiting observations to resources and
resource instances without any reason.
Also if resource is written, and the whole object is observer
it should trigger. Path does not have to be matching on the
same level, if parent is observed.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The expression for the condition for using host-based RPA resolution now
simplifies to "Use host-based when we need to resolve more identities
than the controller can handle.".
Proof:
X=((bt_dev.le.rl_entries > 0) && (!bt_dev.le.rl_size ||
bt_dev.le.rl_entries > bt_dev.le.rl_size))
X=(a > 0) && (!b || a > b)
a>=0, b>=0, because they are cardinal / size_t.
If a=0:
// X evaluates to false. (0 > b)=(a > b) also always evaluates to false.
X=false=(0 > b)=(a > b)
If a>0:
X=(!b || a > b)
If b=0: X=true=(a > 0)=(a > b)
If b>0: X=(false || (a > b))=(a > b)
The expression is equivalent with (a > b) for all values of (a,b).
QED.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>