CONFIG_NET_CONFIG_INIT_TIMEOUT should not only be available if
CONFIG_NET_CONFIG_AUTO_INIT=y. If *_AUTO_INIT=n then application
may wish to initialize net manually and still use configured
timeout.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
If the CONFIG_NET_CONFIG_AUTO_INIT is not set, then let application
to do the initialization manually. In that case the app should call
net_config_init_app() when it is ready to setup the network.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When performing node reset over a proxy connection, the disconnection is
asynchronous, and will finish after the reset callback goes to the
application. If the application restarts provisioning in this callback,
the disconnected-event is triggered after PB GATT is reactivated, and
this error is printed without any faults actually occurring.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Notify L2CAP when pairing procedure fails during SMP pairing
process. L2CAP needs to be notified so that it can cancel
ongoing connection-oriented channel requests.
Rename bt_l2cap_encrypt_change to bt_l2cap_security_changed and
call it from bt_conn_security_changed always, so that L2CAP
is informed when changing security fails.
This also fixes security_changed conn callback not called when
auth_complete returns an error.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Avoid warning in att_handle_rsp, only call this when there is a
pending ATT request. This avoids a warning happens when elevating
security fails but higher security had not been requested by an
ATT request.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
squash! Bluetooth: ATT: Remove warning when no ATT process pending
Elevate the security level before sending the connection request if
the application has set a required security level on the channel.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Elevate the security level of the connection when the l2cap channel
connect request is denied with encryption or authentication error
code.
The l2cap channel required_sec_level was used, but this is not
correct as this is set by the user of the API. This resulted in
the call to bt_conn_set_security seeing that the current security
level was already set, decide there is nothing to be done and return
success.
Fixes: #27220
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Use safe for-each loop in bt_l2cap_encrypt_change since dynamic
channels with pending connection-oriented channel requests will
be canceled and removed from the list if the encryption change
failed.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Remove dependency on CONFIG_BT_ACL_FLOW_CONTROL and use
CONFIG_BT_L2CAP_RX_MTU always to set L2CAP RX MTU.
The ATT MTU is set from two different KConfig options depending
on if CONFIG_BT_ACL_FLOW_CONTROL is enabled, which makes it
a confusing option and hard to provide a conf file that
supports multiple board configurations.
This changes the behavior when CONFIG_BT_ACL_FLOW_CONTROL and
CONFIG_BT_BUF_RX_LEN was used to set the L2CAP RX MTU, and by
extension the ATT MTU.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Clean up comment typos and wording for expect data functions.
Add a cast to (void *) to match convention set in expect value;
this allows the caller to avoid casting on every single call.
Signed-off-by: Jett Rink <jettrink@google.com>
If you tried to use more mock parameters than were set in
CONFIG_ZTEST_PARAMETER_COUNT, you would get a random seg fault somewhere
unrelated to the mocking parameter as we would use memory past an array
bounds.
Signed-off-by: Jett Rink <jettrink@google.com>
If one enables mocking, then they most likely want more than 1 mockable
or verifiable parameter by default. Bump the default number of mockable
parameters to 10 to handle most cases without needing to touch an
additional Kconfig option.
Signed-off-by: Jett Rink <jettrink@google.com>
Include directories for ${ARCH} is not specified correctly.
Several places in Zephyr, the include directories are specified as:
${ZEPHYR_BASE}/arch/${ARCH}/include
the correct line is:
${ARCH_DIR}/${ARCH}/include
to correctly support out of tree archs.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fix incorrect use of LLL ticker user id in ULL_LOW execution
context.
Regression introduced in commit 23ef75f6d9 ("Bluetooth:
controller: split: Fix Low Latency Prepare Done").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The original return type of tcp_data_get() was unsigned and the
return value <0 was not checked properly.
Fixes#25723
Coverity-CID: 210559
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
For some reason, MCUMgr used to consist of two separate Kconfig
files, likely due to the fact that the author's original intention was
to split the "management" and "mcumgr-specific" options in order to
integrate additional libraries. In practice this never worked out, so
coalesce them into a single file.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The LwM2M server might modify the lifetime value while the device is
registered, hence it's needed to obtain the value directly from the
Server object instance, before each Register Update.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A proper way to match a Security object instance with a Server object
instance is via Short Server ID resource. Both coupled object instances
should carry the same value of this resource in order to me considered
matched.
This was not implemented in the LwM2M library and it was incorrectly
assumed that the Security object instance index corresponds to the
Server object instance index. While such apporach works is simple
scenario, it might yield incorrect results when bootstrap is used.
Fix this, by verifyng the Short Server ID resource in the Secuirty
instance used, and finding a matching Server instance. The server object
instance is stored for future use in the engine.
Additionally, remove an extra Server object instance that was created
when the bootstrap procedure was used. Since the boostrap Security
object instance does not have the corresponding Server object, it's
enough to have a single Server instance.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove the static buffer for TCP options. Make sure that the
options were read properly to temp buffer.
Fixes: #25729
Coverity-CID: 210056
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Value of this member was never assigned, so it was always 0. Remove it
to simplify code a little bit.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
EATT channels use bt_l2cap_chan_send which does return the number of
bytes sent on success not 0 as bt_l2cap_send.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Zephyr introduced subsys/mgmt folder for MCU management. Move UpdateHub
to this newly and dedicated space.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
This set of functions seem to be there just because of historical
reasons, stemming from Kbuild. They are non-obvious and prone to errors,
so remove them in favor of the `_ifdef()` ones with an explicit
`CONFIG_` condition.
Script used:
git grep -l _if_kconfig | xargs sed -E -i
"s/_if_kconfig\(\s*(\w*)/_ifdef(CONFIG_\U\1\E \1/g"
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Fill the referenced event counter of the Periodic
Advertising SYNC_IND PDU into the sync info struct in the
Common Extended Advertising Header Format.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In order to be able to add more entries under 'subsys/mgmt', move the
current contents of it, which relate exclusively to MCUMgr, to its own
folder.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The definition of the help command has been changed
so that it does not accept the arguments.
Thanks to this it cannot be marked by the "select" command.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
If the command buffer is empty the shell was trying to read a string
from a random memory location. Added a condition checking "argc" value
when the select command is executed.
Fixes: #27227
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
The core kernel computes the initial stack pointer
for a thread, properly aligning it and subtracting out
any random offsets or thread-local storage areas.
arch_new_thread() no longer needs to make any calculations,
an initial stack frame may be placed at the bounds of
the new 'stack_ptr' parameter passed in. This parameter
replaces 'stack_size'.
thread->stack_info is now set before arch_new_thread()
is invoked, z_new_thread_init() has been removed.
The values populated may need to be adjusted on arches
which carve-out MPU guard space from the actual stack
buffer.
thread->stack_info now has a new member 'delta' which
indicates any offset applied for TLS or random offset.
It's used so the calculations don't need to be repeated
if the thread later drops to user mode.
CONFIG_INIT_STACKS logic is now performed inside
z_setup_new_thread(), before arch_new_thread() is called.
thread->stack_info is now defined as the canonical
user-accessible area within the stack object, including
random offsets and TLS. It will never include any
carved-out memory for MPU guards and must be updated at
runtime if guards are removed.
Available stack space is now optimized. Some arches may
need to significantly round up the buffer size to account
for page-level granularity or MPU power-of-two requirements.
This space is now accounted for and used by virtue of
the Z_THREAD_STACK_SIZE_ADJUST() call in z_setup_new_thread.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The fs_open has been extended with support for open flags.
Currently supported flags are:
FS_O_READ -- open for read
FS_O_WRITE -- open for write
FS_O_CREATE -- create file if it does not exist
FS_O_APPEND -- move to the end of file before each write
The FAT FS and LittleFS front-ends within the Zephyr has also been
modified to utilize the flags.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
If a setting read is attempted from a store that doesn't support
reading return an error rather than faulting.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
It was already using uart_irq_callback_user_data_set below, now it also
uses uart_irq_callback_user_data_t as callback type, so let's normalize
the callbacks.
Fixes#26923
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>