On X86 platforms, the interrupt trigger method has been
changed to use APIC IPI, we don't use INT command to trigger
interrupt, so remove this unused macro.
Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
On X86 platforms, the interrupt trigger method has been changed
from using INT command to using APIC IPI, we need to make sure
the IPI interrupt is handled before do our check, so add some
nop operations.
Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
`bt_conn_index` has been changed to take a `const bt_conn`
which allows our functions that use this to also take a
`const` parameter.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
the CSIS client now has a ordered access procedure function.
The function implements the procedure as per the CSIP spec,
where it will verify that 1 or more members are unlocked,
and the execture a procedure on each member in ascending
order of rank.
The procedure can be anything (even a non-BT procedure),
and it will be up to the applicaiton to implement
what to do in that.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Instead of getting doing look ups for each member
for the CSIS client procedures, we store the active
members ordered by rank.
This is slightly less efficient in cases of error,
but for some procedures as the upcoming Ordered
access procedure where we need to access each
member twice, ordering them once is more
efficient.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Having the members array being const causes a lot of
limitations in the implementatation, and was
occasionally even disregarded. Removed to make the
implementation more flexible.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the client receives att error rsp, but the error code
is an illegal value, such as 0, an exception will be triggered.
gatt_read_type --> gatt_read_type_rsp --> parse_characteristic
`switch (rsp->len) {` null address access.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
The `iso_qos` was only used for connected ISO, but
was placed outside of the CONFIG_BT_ISO_UNICAST
guard, such that for broadcast ISO-only it was unused.
Move the declaration and renamed to cis_iso_qos.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Disable BT_ECC support in network core to reduce RAM usage.
ECC implementation can instead be supported in the Host
running in the application core.
This is also to keep hci_uart (nRF52 Series) and hci_rpmsg
(nRF53 Series) have the same support features. ECC is not
enabled in hci_uart sample.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
As the stack can safely keep allocating data during retransmission mode
there is no need to take the tx_sem during retransmission any more.
Data stored in the send_data buffer will be transmitted upon the ack of
the data for which an ack is pending. This the application being fully
stalled when the TCP connection enters retransmission mode.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
After the window_full function has been fixed by looking at the
send_data_total instead of the unacked_len. There is no risk
in sending data in transmission mode.
This reverts commit 0088aaefa0.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Fix advertising failing to resume with BT_ADV_PERSIST set in
bt_hci_le_adv_set_terminated due to BT_ADV_ENABLED not getting
cleared before bt_le_adv_resume gets called
Signed-off-by: Troels Nilsson <trnn@demant.com>
Sometimes we want to entirely decouple the system PM from the device PM,
leaving the devices to manage its own power states using the runtime PM.
This is currently not possible because the suspend / resume code path is
triggering the device PM hooks even when the runtime PM is enabled.
Introduce a new PM_DEVICE_RUNTIME_EXCLUSIVE symbol to allow the platform
to skip the device PM triggers on suspend / resume.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Encryption request is enqueued in thread context from the Tx
buffer pool, so that it is serialized alongwith the already
enqueued data buffers ensuring they are transmitted out to
peer before encryption is setup. Allocate additional Tx
buffers to accommodate simultaneous encryption setup across
active connections.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
- Prevent NULL-pointer dereferencing if datapath is created late
- Support SDU fragment complete-counting for framed case
Signed-off-by: Morten Priess <mtpr@oticon.com>
Implemented incrementing TX SDU fragment count such that it indicates
the number of completed SDU fragments in the PDU being emitted for both
unframed and framed transmission.
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
HCI:
-- Discarded data from HCI ISO Data packets from controller to host if
data has been lost
ISO-AL:
-- Corrected iso_interval in latency calculations
-- Updated handling and release of SDUs for error conditions / padding
at the last PDU for the SDU
-- Updated prioritisation of error status in released PDUs
-- Included error spooling exit on based on payload number to SDU
mapping for unframed reassembly
-- Updated sequence number handling for framed recombination
Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
Do not use ull_ticker_stop_with_mark for ISO one-shot resume ticker, but
stop without checking result. If active this will stop it, otherwise it
is ignored. Also, this prevents calling lll_disable twice.
Signed-off-by: Morten Priess <mtpr@oticon.com>
- Prioritize CIS_REQ handling in (old) LLCP
- Reject if CIS_REQ uses exisiting CIS ID
These fixes prevent assertions in /LL/CIS/PER/BV-38-C.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Added start, stop and update to the shell.
Refactored the event_cb of the rd_client_info struct into the ctx,
as it was needed in the shell script.
Signed-off-by: Ola Tangen Kulseng <ola.kulseng@nordicsemi.no>
The img_mgmt_impl_erase_if_needed was only called when
CONFIG_IMG_ERASE_PROGRESSIVELY is y, and it does nothing anyway;
because the function always returns 0, and does nothing,
neither the function no result processing, from a call to the
function, is needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The function is no longer needed with fix provided by commit
aa5d20aaef (storage/flash_map: Return -ENODEV from flash_area_open).
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Image management state, struct img_mgmt_state, has been defining
sector_id and sector_end variables, supposed to be used by
progressive erase feature, that have no use in code.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The img_mgmt_upload has been overriding return codes of several
utility function calls with MGMT_ERR_EUNKNOWN, even though
these utility functions would be returning MGMT_ERR_* type codes
already, overshadowing real reason of failure.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit changes types of image, size and offset elements of
img_mgmt_upload_req structure from unsigned long long to size_t.
This commit also fixes comments and conditional statements, where
these identifiers have been compared against -1, although they have
been clearly defined as unsigned.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
uuid wasn't initialized in the publication setting command.
It caused wrong the configuration clietn behavior.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Recent code change asserts on ECRED psm being consistent in
l2cap_ecred_conn_req. However, the values are compared between
endianness converted value and non-converted value, which fails on BE
archs.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This function retrieves TX sync information
(timestamp, offset, and sequence number)
from controller using HCI command HCI_LE_Read_ISO_TX_Sync.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
The functions for Class C mode are already provided by LoRaMAC layer.
A device in this mode is listening for incoming downlink messages almost
continuously, which results in higher energy consumption.
Class C mode is required for FUOTA.
Signed-off-by: Martin Jäger <martin@libre.solar>
Allocated own message buffer for RD client interface.
This helps to cover if all messages are queued and need to do
registration or update.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
(cherry picked from commit 8dca91109d73a4a697e074c58ee9430d56c01a51)
If Notification build fail there was possible that Notification
are blocked after failure.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
(cherry picked from commit 6dfa242c7d891b3458ab88df46b69b3a9621ee82)
Fixed couple possible place for leak Coap pending entry.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
(cherry picked from commit 3c175951383be56fa9c1451845a15b66df41ff64)
Implementing proper validation of PHY selection for PHY UPDATE procedure
Implement connection termination on PHY UPDATE with instant in the past
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Replace k_sem_take loop used for consuming the remaining
sem give counts with k_sem_reset.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix assertion due to multiple mayfly_enqueue calls used
under ZLI when pdu_free_sem_give is invoked from the LLL.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit corrects all `extern K_KERNEL_STACK_ARRAY_DEFINE` macro
usages to use the `K_KERNEL_STACK_ARRAY_DECLARE` macro instead.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Lifetimes are really 32 bit values, so the limitation
did not make sense, and it did not allow 24 hour lifetime.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When performing a combined host and controller build, there is no point
in presenting the option to enable a given host feature if the
controller does not support it. This reduces the list of presented
features to enable/disable.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This reverts commit e11ff7df48.
This patch causes some PTS failure.
Another patch to address duplicate device will follow.
Signed-off-by: Azizah Ibrahim <azizah.ibrahim@nordicsemi.no>
_current_cpu is a macro that expands to an assert that checks if the
current context can be migrated to a another cpu. Since this
pm_system_suspend() is called from the idle thread (each cpu has its
own) and with locked this check is redundant. Just use
arch_curr_cpu() to avoid it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
pm_system_resume() can be called from the idle thread with
interruptions unmasked. In this situation, _current_cpu will call
z_smp_cpu_mobile() that will return true and cause an assert.
In this function we don't need to check if the current context can be
preempted, we just need the information about which cpu is executing
it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The Configure Data Path command must be included when the read Local
Supported Codecs [v2] command is supported. The Configure Data Path
command is needed when vendor-specific ISO data paths are supported,
but not otherwise tied to ISO. The respective weak function is
therefore moved to ull.c.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
Introduce configuration options for chosen RPL implementations.
This will allow introducing alternate persistent storage schemes
for the replay protection list.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
When an L2CAP_CREDIT_BASED_RECONFIGURE_REQ packet is received with
invalid parameters, the recipient shall send an
L2CAP_CREDIT_BASED_RECONFIGURE_RSP PDU with a non-zero Result field
and not change any MTU and MPS values.
This fix incorrectly reconfiguring valid channels while responding with
0x003 (Reconfiguration failed - one or more Destination CIDs invalid)
result code.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
TSE18813 clarified IUT behavior and rejecting reconfiguration which
would result in MTU decrease is enough. There is no need to disconnect
L2CAP channel(s).
This was affecting L2CAP/ECFC/BI-03-C qualification test case
(TCRL 2022-2).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Added test command line arguments to filter
which tests are executed. Filtered tests should follow
suiteA::test1,suiteB::test2 format.
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
When supporting chain PDUs, after HCI reset the first PDU
allocated did not initialize its next pointer causing use
of unallocated PDUs for chaining while a duplicate of such
PDU buffer being allocated for other states/roles. This
causes in certain cases both Extended and Periodic PDUs
having same data, the Extended Advertising PDU being
transmitted at the instant of the Periodic Advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Use Zephyr coding style for variable names and functions where possible.
The function BoardGetUniqueId has to be kept as is to match LoRaMAC
library declarations.
Signed-off-by: Martin Jäger <martin@libre.solar>
Fix BT_CTLR_RX_ENQUEUE_HOLD implementation that stalled
generating the CONN_UPDATE and PHY_UPDATE when there were
no Rx data or Tx acknowledgements to be processed when
the controller was built with BT_CTLR_LOW_LAT_ULL.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
...format to bootstrap registration message with LwM2M v1.1.
SenML CBOR takes precedence, followed by SenML JSON and OMA TLV.
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
Write to an opaque resource failed and it has been fixed. Support for
blockwise transfer is still missing.
Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
This commit aligns openthread radio platform to use `ieee802154_txpwr`
of the packet to transmit instead of setting power through a separate
API call, if possible.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
This commit extends the `struct net_pkt` structure with
`ieee802154_txpwr` field that contains signed value of the desired
transmission power of a IEEE 802.15.4 frame in dBm.
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
idle_rate is uint8_t, sof_cnt is uint32_t. The result is uint32_t, which
is the wrong type for 'abs'. Explicitly cast idle_rate to uint32_t,
subtract sof_cnt and then explicitly cast to int32_t and then use abs,
storing the result in another int32_t which matches the return type for
abs.
This quiets clang warnings about passing unsigned values to abs.
Signed-off-by: Keith Packard <keithp@keithp.com>
This adds checks to avoid setting context that is not indicated as
supported to be available.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Return ret error code instead of always returning zero causing
warnings:
...
subsys/net/lib/dns/resolve.c:975:6: warning: variable 'ret' set but
not used [-Wunused-but-set-variable]
int ret = 0;
^
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fix compilation warnings:
...
subsys/net/lib/dns/dns_pack.c:548:6: warning: variable
'remaining_size' set but not used [-Wunused-but-set-variable]
int remaining_size;
^
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The img_mgmt_upload was getting into loop with requesting
offset 0 from mcumgr, when requested to re-try upload after
write fails.
Because it is not really possible to recover from write fail,
at least currently, the commit changes code to reset upload
state in a case of write error and return an error code.
Now, when write fails, an error will be returned and upload
process will be stopped and reset; upload re-try will behave
as a new upload has been requested.
Fixes#44219
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The offset is checked, for correctness, before the function
img_mgmt_impl_write_image_data is called, so it is redundant to
do the same check within it.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Makes it possible for an application to
handle CSIS RSI advertising by registering a
callback, which will disable the internal
CSIS advertising.
Also fixes registering callbacks in CSIS.
Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Rename the symbols used to denote the locations of the global
constructor lists and modify the Zephyr start-up code accordingly.
On POSIX systems this ensures that the native libc init code won't
find any constructors to run before Zephyr loads.
Fixes#39347, #36858
Signed-off-by: David Palchak <palchak@google.com>
To improve the performance with small chunks send, implement Nagle's
algorithm. Provide the option TCP_NODELAY to disable the algorithm.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
This fixes sending corrupted (incomplete) packets over RTT. Additional
helper buffer has been added to ensure the complete packet before it
can be sent over RTT. Once the complete packet is collected it is sent
to the RTT control block in non-blocking manner. From now there will
be no situation that only part of the packet (e.g. header) is sent
which lead btmon to fail to parse the corrupted data.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This fixes Bluetooth logs that were not sent over RTT.
Minor cleanup has been made to limit the number of ifdefs.
> ACL Data RX: Handle 0 flags 0x02 dlen 11 #1049 83.117000
ATT: Handle Value Indication (0x1d) len 6
Handle: 0x0003
Data: 0100ffff
= bt: bt_att: Unhandled ATT code 0x1d 83.117100
> HCI Event: Disconnect Complete (0x05) plen 4 #1050 84.247700
Status: Success (0x00)
Handle: 0
Reason: Remote User Terminated Connection (0x13)
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add Kconfig option to conditionally enable tickers with slot
window to yield to normal tickers and be placed at the end
of their slot window if possible.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This fixes a minor bug that caused an error if one attempted to encode
or decode INT64_MIN in SenML CBOR
Signed-off-by: Markus Rekdal <markus.rekdal@nordicsemi.no>
This fixes a bug in the decoding of objlinks. Without this the object
instance id is not retrieved correctly as it tries to read the second id
starting from the colon.
Signed-off-by: Markus Rekdal <markus.rekdal@nordicsemi.no>
By default, any string or opaque data that LwM2M engine initializes
sets data lenght to same value as given buffer length for that
resource.
However, on run time, engine keeps track how much data is written
to each resource, so when reading from any resource, should only
return data that has been written there. But uninitialized resources
return the content of the whole buffer.
Fixed the problem by introducing macros INIT_OBJ_RES_LEN(),
INIT_OBJ_RES_MULTI_DATA_LEN() and INIT_OBJ_RES_DATA_LEN() that
allows you to give the amount of data existing in buffer when
the resource is initialized. This sets the data_len and max_data_len
variables correctly.
Also introduced new functions lwm2m_engine_get_res_buf() and
lwm2m_engine_set_res_buf() that distinct between data size and
buffer size. Deprecated the previous functions
lwm2m_engine_get_res_data() and lwm2m_engine_set_res_data()
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Extended logging backend API with log_backend_is_ready call which
returns 0 is backend is ready. Logging core will make sure that
all autostarted backends are ready before they are enabled.
This option allows to handle backends which are not yet ready
after init function is called (e.g. usb backend that is not plugged
in). If this is the only backend in the system, logging processing
will not start util first backend is ready.
Function for checking readiness is optional and when backend has
no such function it is assumed that backend is ready after
initialization function returns which makes this feature backward
compatible.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This removes the check that was causing missalignment in
csis->srv.conn_cnt conunting. The csis->srv.conn_cnt was increased for
each connected device while decreased for bonded only. This caused
assertion in csis_connected when reconnected.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Adds a helper function to query whether a device is currently powered.
This can be used to determine if the chip can be initialised now, or if
it needs to be deferred.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Add flags option to init call and a flag to use cache.
Add Kconfig choice to pick how to approach cache. Cache can be
enforced in all spsc_pbuf instances, disable in all, or runtime selected
based on configuration flag. Option is added to allow memory footprint
savings.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Move icmsg_buf to lib/os and rename to spsc_pbuf (Single Producer
Single Consumer Packet Buffer). It is a generic module and initially
was created as internal module for ipc service.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
In the function net_tcp_queue_data. When an -ENOBUFS by
tcp_send_queued_data is returned, it throws away the whole block of size
len from the send_data. If the len is > MSS, it could happen that the
first section is transmitted, but at the second an -ENOBUFS occurs.
In that case the data is transmitted, but later on removed from the
send_data.
To circumvent this problem, check if the len + unacked_len is smaller
then the send_data_total. If so, the data can safely be removed from
send_data. Otherwise, just pretend the transmission went OK. The
acknowledgment and retransmit path will eventually take care of it.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The window full computation was corrected to use the send_total instead
of the unacked_len. This conflicted with the new polling implementation
due to the moment when these values are changed.
Move taking the tx_sem outside of tcp_send_queued_data to handle the
-ENOBUF situation properly in case called from net_tcp_queue_data.
net_tcp_queue_data removes data from the send_data in case the
transmission failed with -ENOBUF. This cause the buffer to be not full
any more.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Log an error to explicitly log a failed buffer allocation in TCP
retransmission. This avoids silently failing retransmissions due to
repeating buffer allocation failures.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
When there was no room to transmit the a next packet to be transmitted,
the -ENOBUFS could cause the retransmission to fail.
Secondly the conn->unacked_len can be set to 0 in the retransmission
process, causing the subscribtion to the transmit timer to fail. Use the
variable send_data_total instead.
Make sure that is the send_data buffer becomes empty the send_timer is
cancelled, but make sure any pending data still keeps on being transmitted.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The function tcp_data_get tries to update the TCP receive window using
net_context_update_recv_wnd. This function graps the context lock while
the tcp_data_get is called from a situation where it already has tcp lock
is already. Transmission actions do first grab the the context lock and
try to grab the tcp lock afterwards. The combination of both can cause a
deadlock.
By taking the shortcut to directly update the tcp receive window without
going through the net context, the context lock is not required avoiding a
possible deadlock situation.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
In the existing the value received from the other side by the TCP options
is used as MSS for transmission. Since the MSS options are an
announcement rather then a negotionation, it is likely the receiver will
have a different and possibly bigger MSS than allowed by our side.
This allow potentially for different a MSS in the receive and transmit
path.
Directly using the received MSS could cause problems when our MSS is only
allowed to be small. At transmission, for that reason take the minimum of
the received MSS and our desired MSS to find a value compatible to both
sides of the link.
Rename the function to net_tcp_get_recv_mss to net_tcp_get_supported_mss
to better reflect its function in the new situation.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
The HAS sends notifications to paired devices. Thus the client context
has to be initialized once the link has required security.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The Sink Audio Locations and Source Audio Locations characteristics are
optionally writtable as defined in PACS_v1.0.
If the property is not mandatory in the specification it should be
disabled in implementation by default. It is more likely that the
location value will not change over time, as the end-product would
be designed to be used in specific way (in specific location).
If the user wants to make use of the writtable location feature, then
one has to enable it explicitly.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Special function for supporting various types of buffers,
via provided callbacks, is no longer needed when net_buf is the
only type of transport buffer used by mcumgr.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The additional logic of zephyr_smp_trim_front is no longer needed
and net_buf_pul can be directly used to trim front of net_buf
response when fragmenting.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Rename the BT_ISO_INTERVAL_MIN/MAX to
BT_ISO_SDU_INTERVAL_MIN/MAX to avoid confusing this
the the ISO interval which is different from the SDU
interval.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add two new parameters to bt_iso_chan_send:
sn: The packet sequence number which shall be incremeted
per SDU interval.
ts: An optional timestamp value used to synchronize SDUs.
The sequence number in the API uses a 32-bit value even though
the sequence number for the HCI command is 16-bit. This is to
properly handle wrapping of sequence numbers, which is much
easier to do with additional bits allocated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
CONFIG_LOG2_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS was added as
a stop-gap measure to support Sys-T catalog messages. Since
the Sys-T backend has envolved to use tagged argument, this
kconfig and its effect are no longer needed. So remove it.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This extends Sys-T catalog messages support for other architectures,
by utilizing tagged arguments to prepare the catalog messages. So
this is no longer limited to architectures where the printf
argument list has the exact format as the catalog message argument
list.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds support for packaging with tagged arguments for log
messages so that backends can make use of this information
when they process messages.
Note that currently tagged arguments must be used with
CONFIG_LOG2_ALWAYS_RUNTIME where log messages are created via
z_log_msg2_runtime_{v,}create(). For some reason, using C++ on
Cortex-M (mps2_an385) results in an additional empty string
argument being added to the list. This does not happen if only
doing C on mps2_an385, or on other architectures.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
`bt_mesh_rpl_check` stops iterating `replay_list` if either it found an
entry with the requested source address or unassigned address. When IV
index updated, `bt_mesh_rpl_reset` is called. It will set `old_iv` to 1
for all entries with fresh IV index and remove entries with old IV index.
If the entries with old IV index are mixed with other entries, this will
cause fragmentation of `replay_list`. The next time `bt_mesh_rpl_check`
is called, it may stop iterating `replay_list` earlier than it should
because it will meet an empty entry before it iterates over all entries
in the list.
This commit does defragmentatino of `replay_list` on every
`bt_mesh_rpl_reset` by shiting existing entries to the vacated places.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This reverts commit 7f51907fda.
The problem with setting the priority at the highest priority possible
is that when the IPC is under high traffic, the WQ could starve the
scheduler.
Move back to a more sane preemptive priority as default value.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Json library parser modify data so thats why we can't parse same
data again. Now Composite observation handler parse SenML Json or
CBOR resource path which is given to new API composite Read API
which not need any new data parser.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Integrated updated JSON library to LwM2M 1.0 JSON.
Removed Old Json format default choice.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Integrated updated JSON library to SenML-JSON.
This integrate affect that Coap Block wise transfer is not
supported.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
The commit fixes issue where image management would switch to using
heap, whether developer wanted or not, when CONFIG_HEAP_MEM_POOL
gets value greater than zero.
Now when heap is enabled the user can select whether image management
will keep on using static variable, taking static RAM, or will use
heap to allocate the flash image context only when needed.
For this purpose CONFIG_IMG_MGMT_USE_HEAP_FOR_FLASH_IMG_CONTEXT
has been added, which is available when CONFIG_HEAP_MEM_POOL is enabled.
Fixes#44214
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The open source controller did not expose support for shutting it down
via the close() API in the HCI driver. Add support for it, which
completes the support for disabling and enabling the Bluetooth stack in
Zephyr.
Closes#3192.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Allow the controller to be deinitialized, adding the whole chain of
calls:
- ll_deinit()
- lll_deinit()
- lll_clock_deinit()
in order to be able to turn everything off, including the controller's
refcount of the LF clock.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When bt_disable() was introduced, some of the global variables that
handle key aspects of Bluetooth were not converted to be also
re-initialized every time that the stack was disabled and the enabled
again. This meant that the FIFO and semaphore in the device structure
were not reset whenever the corresponding threads using them were shut
down and then restarted.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The ipc_service_get_tx_buffer() has a timeout parameter that can be used
to wait a certain amount of time for a TX buffer to be available.
Unfortunately, for the static vrings backend, an asymmetry
between remote and host exists that makes the usage of this parameter
confusing when the user requests a buffer when no buffers are available
at that time.
When the remote endpoints requests a TX buffer specifying a certain
size and there are no TX buffers available, the function ignores the
parameter and ipc_service_get_tx_buffer() immediately returns -ENOMEM.
The same case on the host endpoint works correctly only when the
specified timeout is <= 15 seconds. All timeouts > 15 seconds simply
returns -EIO after 15 seconds.
This patch is reworking the timeout management trying to behave
correctly in all the cases.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The current PHY is read only when automatic PHY
update procedure is enabled, 2M PHY is supported and
extended advertising is enabled and this is done after
application is notified about connection. This leads
to invalid connection info PHY data which always returns
1M PHY because when using extended advertising the connection
can be established on different PHY and host does not read
this value from the controller in most cases. In order to
have a current PHY value updated we need to read it in
connection complete event before the user application
is notified about connection.
Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
The commit replaces direct access to flash_img_context, for the
purpose of checking how much data has been written, with call
to the flash_img_bytes_written.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Recently OpenAMP introduced the possibility to set the sizes for TX and
RX buffers per created instance. Expose this also to Zephyr users by
using a DT property "zephyr,buffer-size".
For the sake of simplicity use the same DT property to set the buffer
size for both TX and RX buffers.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The automatic elevation of security and retry of ATT requests interferes
with some tests that expect authentication failures.
Affecting GATT/CL/GAR/BI-42-C
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
EATT is not a requirement for the Multiple Variable Length Read
procedure, but previously one had to enable CONFIG_BT_EATT to enable
support for it.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
This fixes Kconfig that allowed to build PACS without support for sink
or source PACS. Few conditionals that no longer apply were removed.
Enabling ASCS support in specific direction enables related PACS
support.
Since PACS does `depends on` anything, it's safe to make use of `select`
statement.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This renames the UUID to follow the same naming scheme as for
BT_UUID_PACS_SUPPORTED_CONTEXT.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The NVS data lookup time grows linearly with the number of
allocation table entries to walk through, meaning that if
some data pair in the NVS changes frequently, access to
other data pairs that change rarely can take a lot of time.
It is particularly visible when the NVS is used as the
settings backend since the backend needs to perform multiple
NVS reads to find a requested key.
Implement a simple cache that stores an address of the most
recent ATE for all NVS IDs that fall into the given cache
position. CRC8/16 is used as a hash function used to
distribute NVS IDs across the cache entries.
The cache entries are only invalidated when an NVS sector
is erased as part of the garbage collector task.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Currently a shallow clone of a packet will bump the reference count on
all the fragments. The net_pkt_unref() function, however, only drops the
reference count on the head fragment. Fix this by only bumping the ref
count on the head buf during shallow clone.
Only bumping the ref count of head is more in line with the idea that
head buf is not responsible for the fragments of its child.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
The commit adds check, to flash_area_open, whether there is any
device driver attached and returns -ENODEV if there isn't any.
This works around a problem where flash_area_open succeeds but
consecutive read/write causes crash.
It is enough to check the condition, and return error, here as
the flash_area_open has to precede, and be checked for success,
any read/write operations.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add a pseudo device diver with device tree bindings for coredump.
The device tree bindings exposes memory address/size values to be
included in any dump. And the driver exposes an API to add/remove
dump memory regions at runtime.
Signed-off-by: Mark Holden <mholden@fb.com>
This fixes a bug in the decoding of objlinks. Without this the object
instance id is not retrieved correctly as it tries to read the second id
starting from the colon.
Signed-off-by: Markus Rekdal <markus.rekdal@nordicsemi.no>
The unicast audio group can not have streams removed after the
CIG has been created as part of the QoS set procedure.
The bt_audio_unicast_group_remove_streams function may
leave the unicast group without streams, and thus the
check for "free" group was not correct, and has been replaced
with a simple boolean value.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The unicast client and server will attempt to use a
bidirectional CIS instead of two unidirectional CIS
whenever possible.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change the return type of bt_audio_codec_qos_to_iso_qos to
void as it cannot fail, and this will make it easier to use.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add supporting for referercing either a sink endpoint,
a source endpoint or both in the bt_audio_iso struct.
This way a single bt_audio_iso can have references to up
to 2 endpoints.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Moves the bt_iso_chan and bt_iso_chan_qos structs
out from the bt_audio_ep struct, and instead use a
reference.
This is due to the fact that an endpoint can ever
only be unidirectional, and a CIS can be bidrectional.
The support for using a single bididrectional CIS
for two audio streams/endpoints is not implemented
in this commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the NULL-check for the iso_server to an earlier point.
There's no need to do anything on the device if no iso_server
has been registered.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The "iso connect" now also takes a security level option like
"iso listen", so that the central can easily encrypt
and connect a CIS in a single command.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The ISO security implementation works by verifying
against the acl (bt_conn) sec_level field. The
bt_conn sec_level field is only available
if CONFIG_BT_SMP is enabled, so this commit
adds guards for all ISO security checks as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If the required_sec_level is lower than the
conn->sec_level, the central will now initialize the
security procecure to ensure that the CIS is encrypted
properly.
The algorithm implemented is as follows:
1) Check security levels for each (acl, iso) pair
2) For those with insufficient security,
call bt_conn_set_security
3) For those with sufficient security, connect the CIS
4) Once the ISO from 2) has been encrypted, connect the
CIS for the specific ACL
The idea behind this was to implement similar support
for autonomous encryption as we have for L2CAP.
It is more complex for ISO as we are dealing with
an array of (acl, iso) pairs, meaning more can go
wrong.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add check for connection and server security
levels, and reject the CIS if the ACL security
level is too low.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The API is documented as being blocking. Making it nonblocking was an
unintentional API change.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
The L2CAP channel ops->sent callback was required to call the
l2cap_chan_sdu_sent callback.
Previously, the only difference between the l2cap_chan_sdu_sent and
l2cap_chan_seg_sent callbacks was that l2cap_chan_sdu_sent called
ops->sent. This is no longer true and l2cap_chan_sdu_sent should always
be called when an SDU is sent.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Datagrams should either be fully sent or not sent at all if networking
buffers or network interface MTU does not allow that. So far the behavior
was to truncate outgoing packets, even for datagram sockets.
When there is not enough available payload buffer to fit all requested
data, fail if that happens for datagram socket.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
error: 'CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH' undeclared (first use
in this function); did you mean
'CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH'?
292 | CONFIG_BT_TBS_MAX_PROVIDER_NAME_LENGTH);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| CONFIG_BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH
etc.
This fixes build errors that were seen while building call control
client without server side (`CONFIG_BT_TBS`) enabled.
The options like BT_TBS_CLIENT_MAX_URI_LENGTH and
BT_TBS_CLIENT_MAX_PROVIDER_NAME_LENGTH have been removed because those
were not used in the code. In fact the client implementation used the
common options for BT_TBS_MAX_URI_LENGTH and
BT_TBS_MAX_PROVIDER_NAME_LENGTH that were moved in this patch to the
common Kconfig section.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
To be able to accept DHCP discover/request incoming packets the ip stack
neeeds to accept unspecified src addr if the destination is broadcast
address.
Signed-off-by: Olof Winge <olof@skyshaper.net>
Create the URI resource when creating the object if
PULL support is enabled.
URI write callback should be post-write instead to ensure
the URI value is updated for the resource.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
Add Kconfig option to the Ethernet L2 which allows to forward frames
with unknown EtherType further into the stack. This can be useful for
packet sockets, where further frame processing is application dependent.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It turns out that all of the items listed under TODO section for packet
socket implmeentation has been adressed over time, threfore remove the
obsolete TODO.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Datagram AF_PACKET sockets were not processed properly by the net stack.
Instead of receving a packet already processed L2, and thus with L2
header trimmed, it was receiving a raw, unprocessed packet.
Fix this by calling net_packet_socket_input() for the second time, after
L2 has processed the packet. An updated connection handler module will
forward the packet correctly based on the corresponding socket type and
packet L2 processing status.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Currently, the packet socket implementation in net_context required that
netowrk interface to transmit the packet to was set on every sendto()
call. This spoils the whole idea of binding a socket. Fix this, by
checking first if the net_conext is already bound to a particular
interface, and if so, do not throw an error in case sll_ifindex field is
not a valid interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Somehow two files in subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src ended up
using STRINGIFY but nothing in their include path ended up pulling in
zephyr/toolchain/common.h. Include that via zephyr/toolchain.h.
v2:
Use non-internal zephyr/toolchain.h header
Signed-off-by: Keith Packard <keithp@keithp.com>
The macro was remove for the GATT discover callbacks,
as only 2 out of 5 parameters for
BT_GATT_ATTRIBUTE were used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The description suggested logging information while it never
was the case: it was about adding additional "rsn":value pair
to an SMP response.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Fix Data Length Request CMD parameter checking to not
restrict invalid maximum Tx time values. This addresses
conformance test cases that provide maximum Tx time values
of 2128 us when not supporting Coded PHY in the Controller
implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The request timer started on the first l2cap channel when doing an MTU
reconfiguration has to be stopped when the response is received. Else the
channel will get into a bad state.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
It is possible, in case of two application images, to have no access
to one of devices of the secondary image.
When asserts are enabled, such situation causes crash even though the
image list command can handle it with no problem.
The commit removes the assert and adds additional swap type:
IMG_MGMT_SWAP_TYPE_UNKNOWN to indicate situations where it was
not possible to obtain swap type from boot_util.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
If there is a PHY change on a connection it may happen that effective
RX and TX time changes also. That change is applied after an instant.
Implemented handling of effective time calculation is based on the
maximum PDU length, new PHY and local (default) maximum TX or RX time.
The maximum TX value is set to default one that corresponds to PHY 1M
during the Controller initialization. It can be updated by host to other
value. By default Zephyr Host updates it to max possible TX time for all
supported PHYs. If PHY CODED is enabled, it is the longest possible TX
duration 17040 us.
The maximum RX value is set to default during connection creation.
In case of use of legacy advertising, the value is also related with
PHY 1M. It can be updated by data length extension procedure.
If the maximum RX value is set to some value and there is a change
of a PHY to one that requires more time to send a PDU with the same
length, then the maximum RX value is wrongly calculated.
Function pu_calc_eff_time returns a value that is the default_time
argument. The problem is that the default_time should be adjusted
to new maximum RX time required for a new PHY.
To solve that there should be an evaluation of a new maximum RX and
TX time based on new PHY.
The commit adds missing evaluation.
The problem occurred in DF tests that check collision mitigation
between PHY update control procedure and CTE request control procedure.
There was missing CONFIG_BT_CTLR_PHY_CODED option in CTE request
unit tests. The code was working because the ULL implementation of
PHY change control procedure does not verify if PHY CODED is supported.
When missing support was enabled, tests showed wrong evaluation of
maximum RX time. It also unveiled error in CTE request unit tests
implementation. The default_tx_time was set to wrong value 2120 us
as if PHY CODED was not supported. To fix it, the value was changed
to PDU_DC_PAYLOAD_TIME_MAX_CODED.
There was also added a mock for a feature exchange procedure done
during unit tests setup step. That allows to correctly calculate
maximum TX time by ull_dle_max_time_get function.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix filter accept list and privacy feature Kconfig default
based on whether host has them enabled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing BT_CTLR_PRIVACY conditional compilations that
included redundant HAL code when Controller privacy is
disabled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix PHY update procedure to handle unsupported PHY requested
by peer central device. PHY update complete will not be
generated to Host, connection is maintained on the old
PHY and the Controller will not respond to PDUs received on
the unsupported PHY.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The commit replaces MGMT_ERR_ENOMEM with MGMT_ERR_EMSGSIZE where it
was used to indicate that SMP response does not fit in response
buffer.
Fixes#44535
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Fixes issue re. sending packets after sending TERMINATE_IND.
Fixes issue re. erroneous error code on 'timed out' termination (ie
when peer does not ack terminate_ind)
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
On a completion of feature exchange the max DLE times needs to be
updated if Coded PHY has become supported.
For this now also keep a separate store of the default_tx_octets/time
for the sake of re-calculation of local versions of DLE values
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
The commit fixes incorrect value being passed as used stack
information and also prevents compilation error when
CONFIG_INIT_STACKS is n.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Enhance FCB to also work with sectors larger than 16K and
to handle larger flash alignment constraints correctly.
use fcb_len_in_flash when setting the offset of the data
and use buffers sizes of at least the alignment value.
The test in fcb_test_append_to_big has been altered, as it
would otherwise not come to a data length which fits the
fcb on sectors larger than 16K.
Closes: https://github.com/zephyrproject-rtos/zephyr/issues/45345
Signed-off-by: Achatzi Julian <jachatzi@baumer.com>
Fix prepare pipeline from not resuming non-resume events
in pipeline when more than one resume events are present
before a non-resume event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Core v5.3, Vol 4, Part E, 7.8.38
Controller has the option to accept or reject when the same device
is added to RL.
If a remote device has been added to RL before, then local device
change it's advertsing address, and the remote device tries to pair
with the new address, we could end up trying to add the same data to RL.
If a remote device's public/static address is known, this patch deletes
the old entry from RL before adding it.
Signed-off-by: Azizah Ibrahim <azizah.ibrahim@nordicsemi.no>
In other places, img_mgmt_dfu_stopped() is called when
a failure occurs and the DFU cannot be continued. In this
place, however, the function is called on success which
does not seem to be correct.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
When host issue HCI Reset controller should clear LE Static Random
address. Otherwise controller may incorrectly use one from before
HCI reset insread of rejecting HCI commands.
This was affecting following qualification test cases:
HCI/CCO/BI-51-C
HCI/CCO/BI-53-C
HCI/CCO/BI-54-C
HCI/CCO/BI-56-C
HCI/DDI/BI-06-C
HCI/DDI/BI-07-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Fragmented data passed to sendmsg() should be sent as a single datagram in
case of datagram sockets (i.e. DTLS connection). Right now that is not
happening now, as each fragment is sent separately, which works fine only
for stream sockets.
There is no mbedTLS API for 'gather' write at this moment. This means that
implementing sendmsg() would require allocating contiguous memory area at
Zephyr TLS socket level and copying all data fragments before passing to
mbedTLS library. While this might be a good option for future, let's just
check if data passed to sendmsg() API consists of a single memory region
and can be sent using single send request. Return EMSGSIZE error if there
are more then one data fragments.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
At least one supported PHY bit shall be set and none of
non-supported or RFU bits should be set.
This was affecting HCI/DDI/BI-05-C qualification test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Removes label experimental for direction finding feature in
Bluetooth Controller.
The feature stays disabled by default because it requires additional
dedicated hardware to be used. Besides that it significantly enlarges
amount of memory used by the Controller.
End user has to enable the feature explicitly by use of configuration
options.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix preempt timeout scheduling to not skip first prepare in
pipeline when there are no previous preempt timeout
scheduled already.
Fix related to commit 27b8beaa22 ("Bluetooth: Controller:
Fix to handle relative short preempt timeout").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Maximum number of CTE to be send in a periodic advertising chain is
limited by BT 5.3 Vol 4 Part E, section 7.8.80 and is 16.
Maximum number of samples CTE in a periodic advertising chain is
limited by BT 5.3 Vol 4 Part E, section 7.8.82 and is also 16.
Both values are limited by amount of memory reserved in Controller
by Kcofigs, respectfully: CONFIG_BT_CTLR_DF_PER_ADV_CTE_NUM_MAX and
CONFIG_BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX.
Functions ll_df_set_cl_cte_tx_params and ll_df_set_cl_iq_sampling_enable
check limits against Bluetooth specification provided values.
That can end with memory overwrite if number of requested CTEs is
greater that number provided in configuration.
The commit changes mentioned functions to validate HCI commands
parameters against configuration values.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
In case there are pending two control procedures: local and remote,
and remote device sends LL_REJECT_IND PDU then assertion happened.
ull_cp_rx function triggers assertion because LL_REJECT_IND is
considered as expected packet for all local and remote control
procedures.
That is not correct. It does not allow local procedure to handle
a response and stops a device on assert.
A remote device should not send LL_REJECT_IND PDU for locally initiated
control procedures, hence local device should not expect to receive
LL_REJECT_IND PDU to be expected one for pending remote control
procedure.
Remote device is allowed to send LL_REJECT_EXT_IND PDU for a locally
initiated control procedures. The LL_REJECT_EXT_IND PDU has a Reject-
Opcode that identifies rejected control procedure, hence is may be
expected by local device.
The commit provides changes that prevent the Controller assertion
in described case.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
CCM during on-the-fly decryption of a received packet starts decryption
when Radio triggers EVETNS_ADDRESS. In case there is possibility a
packet may include Constant Tone Extension, on-the-fly parsing of a
received packet for CTEInfo is enabled.
If there is a PHY 1M enabled the Radio stores received bits with a
delay, that is equal to time required to receive 3 bits. CCM TASKS_CRYPT
related with packet decryption should be delayed by the time the Radio
needs to store received data.
The commit provides changes required to delay start of the CCM
TASKS_CRYPT. It uses NRF_RADIO Bit counter feature. The Bit counter is
configured to trigger NRF_RADIO->EVENTS_BCMATCH on reception of 3rd bit.
The event is connected through PPI with CCM TASKS_CRYPT.
The PPI used is shared with Radio Rate override. That is possible because
direction finding feature is not allowed on PHY Coded and CCM needs a delay
only when used PHY 1M.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
lll_conn_rx_pkt_set function is called before one of radio_switch-
_complete_XXX functions calls in lll_peripheral.c. That prevents
lll_conn_rx_pkt to call any Radio setup related function that touches
NRF_RADIO->SHORTS. NRF_RADIO->SHORTS are assigned in radio_switch_-
complete_XXX functions, hence any change operation on the register done
before is overwritten.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Update the new API to use K_USER as the flags for both
CONFIG_USERSPACE and CONFIG_TEST_USERSPACE. Also, fix the linker
script to properly include the suites, tests, and rules.
Fixes#44108
Signed-off-by: Yuval Peress <peress@google.com>
Add initial support for Periodic Advertising Data fragment
operation support.
This commit is limited to detection of partial data if used
before Periodic Advertising is enabled, which will lead to
HCI error reason of command disallowed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove the deprecated BT_WHITELIST Kconfig option. Also,
remove a mention of the deleted bt_conn_create_auto_le API.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When resolving collision if ticks_slot_window is set for
either of the ticker then skip and such ticker be
rescheduled outside the collision within the
ticks_slot_window.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Allow to cancel a firmware update in DOWNLOADED state by writing a
NULL byte as described in the Firmware Update object version 1.1
(urn:oma:lwm2m:oma:5:1.1). Keep object version 1.0 mechanism with
an `empty string`.
Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
[140/235] Building C object zephyr/subsys/bluetooth/controller/
CMakeFiles/subsys__bluetooth__controller.dir/ll_sw/ull_sched.c.obj
In file included from zephyr/subsys/bluetooth/controller/ll_sw/
ull_sched.c:28:
zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_pdu.h:
In function 'lll_adv_pdu_linked_next_get':
zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_pdu.h:8:32:
warning: implicit declaration of function 'MROUND'
[-Wimplicit-function-declaration]
8 | #define PDU_ADV_MEM_SIZE MROUND(PDU_AC_LL_HEADER_SIZE + \
| ^~~~~~
zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_pdu.h:12:11:
note: in expansion of macro 'PDU_ADV_MEM_SIZE'
12 | PDU_ADV_MEM_SIZE - \
| ^~~~~~~~~~~~~~~~
zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv_pdu.h:197:9:
note: in expansion of macro 'PDU_ADV_NEXT_PTR'
197 | return PDU_ADV_NEXT_PTR(pdu);
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
In the stack both unacked_len and send_data_total track the amount
of data for retransmission. send_data_total actually accounts the
total bytes in the buffer, where unacked_len is used to control the
retransmission progress.
Using unacked_len is sometimes reset to 0, this can lead to more data
being allowd in the send_data buffer. In worse case this can cause
depletion of the net buffers, causing a stall and crash of the connection.
The value send_data_total actually accounts the total amount of data in
the send_data buffer, so it is the proper value to used in the
tcp_window_full function.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Rework instant based procedure complete event generation to be
held until after the on-air instant has elapsed, to have
conditional compilation around the code where the event
generation be held or immediately dispatched so that it
improves readability.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix instant based procedure complete event generation to be
held until after the on-air instant has elapsed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The L2CAP channel section is sorted lexicographically. Make sure
that ATT fixed channel will be placed as the last one to ensure
that SMP channel is properly initialized before bt_att_connected
tries to send security request.
Fixes#45820
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
If peer sents invalid value in DLE request or response just ignore
those and keep using old values when calculating effective DLE.
This was affecting following qualification test cases:
LL/CON/PER/BI-10-C
LL/CON/PER/BI-11-C
LL/CON/PER/BI-12-C
LL/CON/CEN/BI-07-C
LL/CON/CEN/BI-08-C
LL/CON/CEN/BI-09-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
In the function tcp_send_data, the variable conn->unacked_len in copied
into a local variable pos. This value is only used in one location and
used mixed with the original conn->unacked_len.
This fix removes pos and switches to use conn->unacked_len everywhere
to reduce the chance of confusion. This does not functionally change the
code.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Terminate connection when Connection Update with instant in the past
Fix type re. win_offset calc in conn update ind pdu decoder
Remove feature bit on unsupported in peer
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
Upon collision either the error code for different procedure
collision or same procedure collision must be transmitted,
which is fixed in this PR. Previously always the error code
for same procedure collision was sent
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
Add Extended Advertising Type validation when associated
Periodic Advertising is enable, and Extended Advertising
set is re-configured to other advertising types.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
There is an error. CTE request control procedure can be run in single
shot or periodic mode. In case of run in single show, it is not
disabled after completion.
The code responsible for the disable was deleted by commit:
ac7d0506f88508e7440288c1ec4319a9f7d0ad44.
The cte_req.is_enabled should be set to zero if the CTE request
completes and cte_req.req_interval is zero.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was missing code responsible for handling of unexpected response
for CTE request. The commit adds code that will terminate connection
in case a peer device reposnes with unexpected control PDU that is not
a remote procedure reques.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The CTE request procedure should be enabled only if a peer supports
CTE response feature. That information can be obtained by feature
exchange procedure. If there were no feature exchange then CTE
request feature may be disabled if a peer responses with LL_UNKNOWN_RSP
for a CTE request.
The implementation of ll_df_set_conn_cte_req_enable was checking if
CTE response feature is supported only when there was feature exchange.
There was missing possibility to stop CTE request if a peer responded
with LL_UNKNOWN_RSP for an earlier CTE request.
The commit changes the implementation of ll_df_set_conn_cte_req_enable.
The CTE response feature check is moved to ull_cp_cte_req function,
because it belongs more to control procedure than to function that
handles Host request to start the procedure.
Second change is related with use of conn->llcp.fex.features_used.
It stores information about features supported by peer. It does
not depend on execution of the feature exchange control procedure.
By the way, there were removed else statement in ll_df_set_conn_cte_-
req_enable because it was not needed.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There was missing handling of LL_UNKNOWN_RSP in CTE request control
procedure.In case there is a pending CTE request and peer responses
with LL_UNKNOWN_RSP then Host should be notified with HCI_LE_CTE_-
Request_Failed event. The pending CTE request procedure should be
completed.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix handling of AD Data set with operation type of
unchanged data with respect to invalid parameter and
state of Periodic Advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix nRF51x series advertising channel PDU S1 byte
configuration regression, that causes corrupted advertising
PDUs being reported to Host, by adding the missing bits_s1
local variable initialization.
Regression introduced in commit 1dcbe73cc8 ("Bluetooth:
controller: radio: add setting of S1 byte in radio packet").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Implement POLLOUT for stream sockets, based on newly introduced tx_sem
functionality of the TCP stack.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>