The Health Client model supports periodic publication and thus requires
the update callback to be initialized.
This commit implements a callback inside the health client model and
adds a wrapper to it so that the user can fill up the msg buffer.
This way, the Config Server will always accept
Config Model Publication Set message with periodic publication
parameters. If the users callback returns an error or is not
implemented, the periodic publication will be aborted.
Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
when performing a write ZMS checks if the data exists in the storage to
avoid double writing the same data and save some memory cycle life time.
However this downgrades the write performance.
Enable this feature only when CONFIG_ZMS_NO_DOUBLE_WRITE is enabled.
Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
This is based on the introduction of a helper Kconfig symbol in
"subsys/random/Kconfig" which is named CSPRNG_AVAILABLE. When this is
enabled it means that there is a "zephyr,entropy" property defined in the
device-tree, therefore Mbed TLS can select ENTROPY_GENERATOR to allow
the platform specific driver to be included into the build.
This commit also changes other locations where CSPRNG_ENABLED was used
moving it to CSPRNG_AVAILABLE in order to solve dependency loop
build failures.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Use the net_icmp_send_echo_request_no_wait() when sending
ICMP Echo-Req so that we can avoid the warning message from
system workqueue handler.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Create a net_icmp_send_echo_request_no_wait() variant that will
not wait when allocating net_buf to be sent. This variant will avoid
a warning to be printed when sending Echo-Req from a system workqueue
because the work cannot sleep in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Once proxy gatt is enabled, due to the nature of gatt advertisements
being continuous, the controller will reject starting the scanner after
enabling proxy gatt. As such we should start the scanner first.
Currently the order works as we are using k_work to postpone the proxy
gatt service registration, because services can't be registered between
initializing BT and loading the settings.
Once we start using the new settings priority feature, we are sure to
envoke enabling proxy gatt after loading the settings, so the delayed
enabling can and should be removed.
This preventetive fix has been tested by running relevant bsim tests
after rearranging in which order the settings of the subsystems are
loaded via `h_commit`.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
If Ethernet based network device driver is advertizing
ETHERNET_EMBEDDED_LL_HEADER, then the L2 driver will can
return the proper L2 header size for the network interface.
This info is then used in TX to determine whether to have a
separate net_buf for the link level header, or to embed the
header to the same net_buf as the L2 payload.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow network device driver to configure the system so that
when a network packet is sent to it, the link layer header
is stored just before the L2 payload in the same packet.
Currently the link layer header is stored in a separate
net_buf that is linked in front of the L2 payload.
This option can typically save one net_buf when sending
a network packet. Note that if you are using variable data
size buffers (CONFIG_NET_BUF_VARIABLE_DATA_SIZE) then this
embedding is not needed because one can allocate just the
right size network buffers and not waste any memory.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If network interface goes operative down, then re-join user defined
IPv4 multicast groups that where joined earlier when the interface comes
up again. If user takes the network interface down manually (admin down),
then the user specific groups are not re-joined. This works now the same
way as IPv6 re-joining.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
At the present time, Zephyr does has overlap between sleeping and
suspending. Not only should sleeping and suspended be orthogonal
states, but we should ensure users always employ the correct API.
For example, to wake a sleeping thread, k_wakeup() should be used,
and to resume a suspended thread, k_thread_resume() should be used.
However, at the present time k_thread_resume() can be used on a
thread that called k_sleep(K_FOREVER). Sleeping should have nothing
to do with suspension.
This commit introduces the new _THREAD_SLEEPING thread state along
with some prep-work to facilitate the decoupling of the sleeping and
suspended thread states.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Extend the list of methods supported by dynamic resources with
PUT/PATCH/DELETE. The methods does not require any extra handling
from the server perspective, so the existing method handlers could be
reused.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.
Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
Add the option for a unique numeric identifiers to be attached to a
zbus channel. This identifier can then be used to lookup the channel
structure at runtime. This is useful in two situations (that I can
immediately think of).
Firstly for external interaction, i.e a text shell or remote procedure
calls. The current state of a channel can be queried by an ID that never
changes, as opposed to the external entity needing to know the exact
memory address of the channel for a given application binary.
Secondly for integrating with dynamically loaded extensions (llext).
These extensions can hook into the existing data streams without each
individual channel needing to be exported and visible to the loader.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The consequences of a wSequence mismatch are unspecified and are
primarily for debugging purposes. Our checks are a bit too strict, and
if the header check fails, the sequence is not updated, and the header
check subsequently fails. Rework the code to just log a warning on
mismatch and also reset OUT sequence counter the same way as the IN
sequence counter.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Align the OUT handling with the CDC NCM and change the logic to track
when the alternate data interface is set/reset instead of the class
implementation being part of the active configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
When interface alternate is set back to zero, the implementation still
attempts to submit OUT transfers, but the addressed endpoint is actually
disabled. Change the logic a bit to track when the alternate data
interface is set/reset instead of the class implementation being part of
the active configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Do not fail in iface_start/iface_stop if sending notification fails,
just log the error and try to send connected notification when alternate
interface is set and network interface is started.
Do not block in notification send function and allow to submit more than
one notification which means that the last valid one will also be
delivered.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The Zephyr network interface should not be disabled by the USB device
functions. This sounds confusing, but in the current implementation they
are different ends of the connection.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
We need to handle notifications periodically, for example, when the
interface alternate changes and we also need to track whether the
notification was actually transfered to the host. There is no need to
trigger notification work on iface_start/iface_stop when the USB
interface is not in active configuration. This commit intentianly
changes log level in the notification handling code.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
In the current implementation, the block length in the OUT direciton
should be equal to the transfer length.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The implementation should not assume that NDP is placed immediately
after NTH. According to the specification (revision 1.0), NDP can be
anywhere in the transfer buffer. There is also always a "terminating
zero datagram pointer entry", which we should also use to terminate the
datagram processing loop.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add the ability to select littlefs disk version
to maintain backward compatibility
with existing littlefs
with the same major disk version.
Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
Currently llext_link_plt() calculates offsets to relocation addresses
relative to the .text section and passes them to
arch_elf_relocate_global() and arch_elf_relocate_local(), where then
.text memory address is added to them. Instead it's more logical to
concentrate the entire calculation in the caller, which then also
removes the assumption, that all sections have the same VMA - LMA
offset from those functions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
With changes introduced in commit 6a3602a306
("net: buf: Clear `user_data` on allocation")
our memset() calls are redundant.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Core spec V5.4 Vol. 3 Part G 2.5.2.1 Robust Caching specifies
the conditions where Database Out Of Sync (0x12) error needs to
be returned as follows:
If a client that has indicated support for robust caching (by
setting the Robust Caching bit in the Client Supported Features
characteristic) is change-unaware then the server shall send an
ATT_ERROR_RSP PDU with the Error Code parameter set to Database
Out Of Sync (0x12) when either of the following happen:
• That client requests an operation at any Attribute Handle or
list of Attribute Handles by sending an ATT request.
• That client sends an ATT_READ_BY_TYPE_REQ PDU with Attribute
Type other than «Include» or «Characteristic» and an Attribute
Handle range other than 0x0001 to 0xFFFF.
Add the conditions to ATT_READ_BY_TYPE_REQ handler.
Signed-off-by: Chang Kim <changshik@meta.com>
The Bluetooth HCI USB transport layer implementation is provided by
"subsys/usb/device/class/bluetooth.c". The USB H4 Bluetooth function
implements a non-standard transport layer. There is no known host-side
equivalent that uses this protocol.
Note that the H4 protocol functionality is also provided by the
"subsys/usb/device/class/bluetooth.c".
Since that there are no real USB H4 Bluetooth users, remove the
implementation and sample without deprecation.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Output a CMake error when the ITS store module is enabled but no
implementation ended up enabled (due to unfulfilled prerequisites).
This is to make it more clear than undefined references at link time.
Not a fatal error because CMake cannot fail for the twister filtering
to work on the tests.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Remove the hard restriction on CONFIG_SECURE_STORAGE_ITS_MAX_DATA_SIZE.
SETTINGS_MAX_VAL_LEN is in practice not used by any settings backend
implementation.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
It becomes the new default when the secure_storage_its_partition
devicetree chosen property is defined as it is a preferred alternative.
See the help message of the
`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS` Kconfig option
for more information.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
There are currently four types of roaming, 11r roaming, 11v roaming, 11k
roaming and legacy roaming, The priority of the roaming mode is
11r-->11v-->11k-->legacy roaming. If the ap does not support 11r/11v/11k
roaming, we will use legacy roaming. legecy roaming needs to do
full channel scan, which is the same as the general scan connection
process, so the legacy roaming time will be longer.
Signed-off-by: Gaofeng Zhang <gaofeng.zhang@nxp.com>
This fixes an issue where wrong values were checked against block device
defaults. Kconfig values are used when no filesystem config values are
provided, and the buffers are sized according to the Kconfig values,
but the checks were only performed against filesystem config variables.
Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
Some ARC processor configurations have separate memory for code (ICCM)
and for data (DCCM). Such configurations are unsuitable for LLEXT,
except for some quite special cases. For now, disable LLEXT and its
tests for these devices completely.
Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
The default exponent is 0, will cause twt setup quick failed,
set exponent value derived from twt interval to fix it.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
In the case of IPV6 not enabled, when NET_SOCKETS_PACKET is enabled,
the sizeof(struct sockarr) will change to 20, the value of
MCUMGR_TRANSPORT_NETBUF_MIN_USER_DATA_SIZE is 8, which is not able
to pass the compilation, so I change its default value to 20.
Fixes#82757
Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
Add WIFI_SAP_IFACE_NO_IR state to keep same as hostapd_iface_state,
which is updated as the hostap upmerge.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
For CMD 'wifi ap status', removing HAPD related definition to make it
more commonly used for non-supplicant case.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Don't check 'HEAP_MEM_POOL_SIZE != 0', as HEAP_MEM_POOL_SIZE might be 0,
but HEAP_MEM_POOL_ADD_SIZE_xxx is defined, which means the actual heap
size is not zero. So check KERNEL_MEM_POOL instead.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>