Updates the LE legacy pairing procedure as a result of errata ES-24491.
New part:
If the initiating device receives an LP_CONFIRM_R value that is equal to
the LP_CONFIRM_I value, the pairing process shall be aborted and fail
with "Confirm Value Failed" as reason.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Add new socket offloading functions, allowing to enable/disable
offloaded DNS implementation at runtime. This may be useful if there is
a mix of offloaded/native network interfaces in the system, so the
application can choose which DNS backend to use.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a new "if_name" pointer to the transport configuration structure,
allowing the application to bind MQTT client to a specific network
interface.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In the function `sdp_client_ss_search()` and
`sdp_client_ssa_search()`, the allocated buf is not released if the
required UUID is invalid.
Un-reference the allocated net buffer if the UUID is invalid.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When the network interface goes down, we call
net_ipv4_autoconf_reset() which removes the autoaddress
from the network interface.
The net_ipv4_autoconf_reset() is also called when ACD is started
in which case we could see this error message
<dbg> net_if_start_acd: Starting ACD for iface 2
<err> net_if: iface 2 addr 169.254.174.230 (net_if_ipv4_addr_rm():4625)
<dbg> net_if_ipv4_addr_rm: Address 169.254.174.230 not found (-22)
This error is superfluous and not needed. So before trying to
remove the address, check if the interface already has it set and
only then remove it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When adding IPv4 address to the network interface, there is no
need to start ACD procedure for localhost or point-to-point links.
The ACD start function would mark the IP address like 127.0.0.1 as
tentative and never make it preferred which would then cause issues
when selecting the network address for sending.
As the ACD start is also called when the network interface comes up,
add the localhost and point-to-point link check to ACD start function
so that we will avoid ACD checks in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
While SPDX license identifiers are usually considered to be
case-insensitive, matching the case of the canonical identifier is
recommended by the SPDX specification.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
remove phy related configs from eth config.
phy related configs chould go directly into the phy.
Most ethernet drivers didn't support the now removed
functions yet. Users should instead use `phy_configure_link()`
together with the `net_eth_get_phy()` function.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add `IPC_SERVICE_BACKEND_ICBMSG_EP_BOUND_WORK_Q_STACK_SIZE` config
and parametrize its value depending on the optimization level.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
A byte received when reception has been disabled
corrupts internal state of the server
(e.g. during transmission of a reply in server mode).
The reponse packet is corrupted and its transmission is aborted and the
data in the buffer is treated by the server as a new incoming packet.
Since the buffer is corrupted CRC doesn't match and the following log
message is printed:
<wrn> modbus_serial: Calculated CRC does not match received CRC
This condition happens when uart_irq_rx_ready() returns true if there is
a new byte in the receive FIFO even with disabled RX interrupt.
The issue has been discovered on a nucleo_u083rc board with a RS485
transceiver with the RI signal floating (a pull-down gives more stable
reproduction). The pull-down ensures that RI is low during transmission
which is seen as byte 0 with a framing error by the receiver.
The byte is received by the MCU and corrupts the response.
Similar effect can be achieved by not disabling the receiver during
transmission (i.e. nRE is driven by the MCU and is fixed low).
The fix discards any data received when reception has been disabled.
Signed-off-by: Maksim Salau <msalau@iotecha.com>
Made a few complex functions simpler
Added missing default cases in switches
Fixes a bad cast that removed const
Moved loop iterators to inner loop
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes a few bad casts that ignored const
Add a few missing final else statement
Refactored aics_discover_func to be less complex by
moving some parts of it into a new function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In order to enable better and more consistent help messages for shell
commands, this commit introduces a new SHELL_HELP macro that allows to
document a command's description and usage in a more structured way.
This will allow to get rid of inconsistent (and duplicated!) variations
of "Syntax: ...", "Syntax:\n ...", "Usage: ...", in the commands, and
formatting of the description+usage will be taken care of by the shell
when it detects the help message is using the "structured" format.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Lines following newlines in shell help text were not properly indented.
For example, in "abc def\ndef ghi\njkl mno", the lines "def ghi" and
"jkl mno" would appear without the expected left margin.
The issue was that after processing a newline and setting proper cursor
position, the function would fall through to z_shell_raw_fprintf() which
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add this to set link speed through net_shell.
Current zephyr version doesn't have user interface to change
speed, hence adding this to accomodate it. Full duplex will
be set by default for each link speed.
Able to change link speed using command below:
net iface set_link <iface idx> <speed> <optional:h(half)/f(full)>
eg: net iface set_link 1 100 h
net iface set_link 1 10 f
net iface set_link 1 1000
Able to set multiple link speed like below:
net iface set_link <iface idx> <speed1> <speed2> <optional:h/f>
eg: net iface set_link 1 10 100 h
net iface set_link 1 1000 f 10
Signed-off-by: Ling Pei Lee <pei.lee.ling@intel.com>
The intention was to use the "interface-name" string property in the
interface string descriptor, but using the label property is acceptable
again. Therefore, allow the use of the DT label property string in the
interface string descriptor.
Follow exactly the same approach as in the CDC ACM implementation
introduced in the commit b0791400f6
("usb: device_next: cdc_acm: allow setting the interface description").
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The `session->param` should be updated to date whatever the function
`sdp_client_ssa_search()`, `sdp_client_sa_search()` or
`sdp_client_ss_search()` can be executed properly.
Update the `session->param` to the new `param` when executing the
function.
Fixes#91156
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The mode is activated by the CONFIG_MODBUS_NONCOMPLIANT_SERIAL_MODE option
and allows any stop-bit setting for the serial port.
Signed-off-by: Maksim Salau <msalau@iotecha.com>
Some applications need to save LLEXT context, e.g. when suspending,
to later restore it quickly without a full relinking. Add 2 functions
for context saving and restoring. Since these functions are likely to
change in the future, put them in llext_experimental.c, which depends
on CONFIG_LLEXT_EXPERIMENTAL and is disabled by default.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Beginning symbols or structure field names with an underscore isn't a
widely used style in Zephyr, remove the leading underscore from
_llext_list.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
NATIVE_APPLICATION is deprecated, let's not use it, let's use instead
NATIVE_BUILD.
unit_testing is not really meant to be covered by NATIVE_APPLICATION,
or NATIVE_BUILD for that matter, as these options are meant for POSIX
arch based targets.
Still, some kconfig options will default to something which will
also be incompatible with unit_testing (primarily CONFIG_PICOLIBC=y)
if we don't set at least NATIVE_BUILD, which would cause some unit
tests to fail. So let's select NATIVE_BUILD to avoid needing to add
extra dependencies on the libCs options.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
There is a potential issue that the index of ACL may out of the
bounds of the array `bt_hfp_hf_pool` if the array size is not aligned
with the array size of `acl_conns`.
To avoid the potential issue, check if the ACL conn index is less than
the array size of `bt_hfp_hf_pool` before accessing the array
`bt_hfp_hf_pool` with ACL conn index.
Fixes#91172
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When there are br connections connected, find_key_in_use call
bt_conn_get_dst to get br connection's dst and bt_conn_get_dst return NULL,
then bt_keys_find_addr aseert because addr is NULL.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
- Remove memset on bt_l2cap_br_chan during SDP
disconnect to prevent overwriting resources
(e.g., rtx_work) still in use by L2CAP,
which handles channel cleanup itself.
- Delete unused partial_resp_queue to clean up code.
Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
If the received data length is less than 2 in none basic mode, the
L2CAP channel connection will be dropped.
Only check the received data length if the `SAR` is
`BT_L2CAP_CONTROL_SAR_START`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Support zero-length SDU sending if the L2CAP channel connection is not
in basic mode.
Flag the zero-length SDU buffer and clear it if it has been processed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The help message for the wifi mode -s command indicates it sets
the Wi-Fi mode to station. However, the Zephyr Wi-Fi shell subsystem
was incorrectly using a get operation instead of set.
This commit corrects the behavior to properly set the Wi-Fi mode,
aligning the implementation with the help message.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Soft ap supports WIFI_BTWT_AGREEMENT_MAX BTWT sessions.
The BTWT parameters for each session can be different.
The current usage can only set one set of parameters.
All sessions follow this set of parameters.
Add enhance code to support setting different
BTWT parameters for every sessions.
Usage:
wifi twt btwt_setup <sta_wait> <offset>
<twtli> <session_num>
<id0> <mantissa0> <exponent0> <nominal_wake0>
<id1> <mantissa1> <exponent1> <nominal_wake1>
<idx> <mantissax> <exponentx> <nominal_wakex>
The total number of '0, 1, ..., x' is session_num
For example:
wifi twt btwt_setup 0 0 0 2 0 112 10 128 1 32 10 64
Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
The usbd_class_remove_all removes all registered classes from a
configuration. However, it previously left the uds_ctx back-pointer to the
usdb_context set, meaning that if the class is re-registered with the
usbd_register_class function, this fails with the error message "Class
registered to other context at different speed" due to uds_ctx being set to
another context.
This patch corrects the issue by clearing udc_ctx after usbd_class_shutdown
has been called.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Commit changes BT_MESH_DFU_FWID_MAXLEN option to be
compliant with BLE Mesh specification.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Fix logging `Could not disable card power via SDHC` when the attempted
operation is turning power on. Update several other logging strings to
minimise the number of unique strings required.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Some applications require loading extensions into the memory which does
not exist during the boot time and cannot be allocated statically. Make
the application responsible for LLEXT heap allocation. Do not allocate
LLEXT heap statically.
Signed-off-by: Alex Ivanov <alexivanov@google.com>
htonl() and htons() take uint32_t/uint16_t as argument. Add the 'u' suffix
to constants to ensure the correct unsigned type is used and to avoid
undefined behavior if these functions are implemented as macros using
bit shifts.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
If the controller resolving list is cleared by HCI_LE_Clear_Resolving_List,
don't need to enable the controller address resolution.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Disable the high-speed USB device descriptor if it is not in use.
Add checks to the code where the high-speed descriptor may be used.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The required buffer is 128 bytes per instance on a full-speed device.
Use common (UDC) buffer, as this results in a smaller footprint.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Disable high-speed descriptors when they are not in use saves 64 bytes
in flash/RAM. It is unlikely that it will scale well enough to be used
in all class implementations or to support a different speed.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add Kconfig option to use dedicated workqueue in CDC ACM but use the
system work queue in CDC ACM by default.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Allowing message callback execution from the USBD thread saves about 800
bytes. For small devices, the option can be useful to reduce flash/RAM
usage, those with enough resources should not bother about it.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>