Commit graph

22,555 commits

Author SHA1 Message Date
Triveni Danda
7b6f2572e5 net: lib: wifi_credentials: Use getopt API for adding network options
Use getopt API to process arguments for `cred add` command.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-03-28 16:10:36 +01:00
Zihao Gao
a0efdb2112 Bluetooth: AVRCP: Move the handling of transaction labels to the App.
According to AVCTP v1.4: On the controller and the target side,
handling of transaction labels is dependent on the application.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
7822bf7628 Bluetooth: AVRCP: Remove AVRCP timeout.
Remove the transaction label mechanism because:
1. Not necessary at stack, typically an application can handle the
timeout mechanism if required (very rarely).
2. It is a burden on memory size to record all pending commands.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
3f747839c5 Bluetooth: AVRCP: expose macros to upper layer.
This patch expose BT_AVRCP_COMPANY_ID_SIZE to applications.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
a4790aeab8 Bluetooth: AVRCP: use spec defined structures on APIs.
This patch replaced the structures defined by zephyr APIs
by those defined by AVRCP Spec.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Zihao Gao
6fe6326bea Bluetooth: AVRCP: implementation of Get Capabilities command.
This patch allows the upper layer to acquire the remote AVRCP
capabilities. These capabilities can be further used in register
notifications.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-03-28 16:10:05 +01:00
Radosław Koppel
26e3e82e60 ipc_service: ipc_icbmsg: Update backend API return values
Update release_rx_buffer return value to match API documentation.
Cleanup register_ept workflow - remove unused variable.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2025-03-28 12:21:30 +01:00
Emil Gydesen
c6e7420d52 Bluetooth: TBS: Client: Fix sizeof('\0')
sizeof('\0') is misleading as it will return 4 instead of 1,
since it will evaluate to sizeof(0), which returns the size
of the `int` type. Modify the expression to use sizeof(char)
with a comment.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-28 12:20:10 +01:00
Daniel Mangum
87d7fcf6c2 bluetooth: host: fix GATT writable Kconfig descriptions
Fixes typos in the BT_DEVICE_NAME_GATT_WRITABLE_SECURITY and
BT_DEVICE_APPEARANCE_GATT_WRITABLE descriptions.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2025-03-28 08:50:05 +01:00
Cla Mattia Galliard
72fcca0304 net: virtual: Fix compiler warnings related to interface name
Fix compiler warning by adjusting the number of chars copied to the
destination. Compiler does not like if the destination size of the
`strncpy`-operation is the same as the number of characters written. Even
though it is not a bug in this case. Only copying size-1 characters fixes
the warning and exhibits the same behavior.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-27 21:33:40 +01:00
Fin Maaß
651d6a3b58 net: dhcpv4: remove redundant dependencys
Remove ``depends on NET_DHCPV4`` on options,
that are inside a ``if NET_DHCPV4``.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-03-27 17:18:49 +01:00
Ingar Kulbrandstad
db84181c22 Bluetooth: Mesh: Fix proxy after board reboot
When the board has been provisioned and the board is rebooted
it was not possible to connect to the board through the proxy
servcie. This fixes that the Mesh Proxy servive is restarted
after the board is rebooted.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2025-03-27 14:02:12 +01:00
Tahsin Mutlugun
d4e87247f0 logging: backends: xtensa_sim: Drop SoC dependencies
Make Xtensa simulator logging backend depend on more generic
SIMULATOR_XTENSA setting instead of individual SoCs.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-03-27 09:51:17 +01:00
Daniel Mangum
36661dc9d4 mgmt: mcumgr: transport: remove dup LoRaWAN smp_reassembly_init
The LoRaWAN SMP transport uses MCUMGR_TRANSPORT_LORAWAN_REASSEMBLY to
enable reassembly. It selects MCUMGR_TRANSPORT_REASSEMBLY, which causes
smp_transport_init to call smp_reassembly_init on the passed transport.
This makes the subsequent call to smp_reassembly_init in the LoRaWAN
transport initialization redundant.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2025-03-27 09:51:08 +01:00
Eric Holmberg
d7bf4b3ddd logging: backend_fs: disable ANSI color for filesystem logging
Before the fix for #77150 was merged, with LOG_BACKEND_SHOW_COLOR=n and
CONFIG_SHELL_VT100_COLORS=y the shell would still display colors by
enabling the flag in the shell_log_backend.c.

Now, LOG_BACKEND_SHOW_COLOR has to be enabled to allow shell logging
color, but that writes ANSI escape sequences to the log files.

Explicitly disable ANSI color output for the filesystem logging backend.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2025-03-27 09:50:59 +01:00
Kiara Navarro
9207a1bcd7 fs: update module logging registration
All modules registered in fs subsystem uses:

LOG_MODULE_REGISTER(<module>, <log level>)

Lets update fs to follow same logic.

Signed-off-by: Kiara Navarro <knavarro@paltatech.com>
2025-03-27 03:50:22 +01:00
Jukka Rissanen
17a4315998 net: mdns_responder: Print return value if error in socket call
If socket call fails when mdns_responder creates listeners, then
print the return value to make it easier to figure out what is
wrong. Typically one needs to increase the size of
CONFIG_ZVFS_OPEN_MAX if errno is ENFILE.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-26 21:57:18 +01:00
Maximilian Deubel
916897f59e lib: tls_credentials: return size even if too big
The simple backend returns the size of the credential,
even if it is too big.
The secure backend should do the same,
our libraries depend on this behaviour.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2025-03-26 16:22:28 +01:00
Jukka Rissanen
2e3f564a95 wifi: shell: Allow setting band to 0 in connect
The help text for connect says

[-b, --band] 0: any band (2:2.4GHz, 5:5GHz, 6:6GHz]

but it disallows setting band to 0. Change this and allow
band 0 option when doing normal connect. Disallow setting
the band 0 when enabling AP mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-26 16:22:01 +01:00
Jukka Rissanen
a8da7d652f wifi: shell: Map negative status code to valid status codes
The negative status code is actually the errno which we might
get returned from lower levels. For example if user sets -t
(timeout) option, the -ETIMEDOUT might be returned. In this case
map the errno value to connection timeout status value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-26 16:22:01 +01:00
Jukka Rissanen
92da8cb69f wifi: shell: Return text description of connection error
If "wifi connect" fails, tell user why in textual format.
This helps debugging connectivity issues.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-26 16:22:01 +01:00
Tom Hughes
918ae79522 net: mdns_responder: Replace pragma with TOOLCHAIN_DISABLE macro
These macros were recently introduced and replaced everywhere (#84065),
but this was missed.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-26 16:20:26 +01:00
Robert Lubos
8935579d0a net: mqtt: Improve disconnect error notification for MQTT 5.0
As MQTT 5.0 allows to specify the disconnect reason in the Disconnect
packet, use this new feature to improve error notification to the
broker, according to the error guidelines in the MQTT 5.0 spec.
For most cases, a generic arbitrary mapping between errno values and
reason codes is used, however the parser can specify the disconnect
reason code manually to better handle certain corner cases (like invalid
topic alias used).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
e9da3b3e0c net: mqtt: Add support for MQTT 5.0 topic aliases
Add support for handling topic aliases received from the broker.
The MQTT client implementation will store received topic for further use
in case consecutive PUBLISH received from the broker contains no topic
but alias only.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
1d743fa65a net: mqtt: Add support for MQTT 5.0 AUTH packet
Add support for a new AUTH message introduced in MQTT 5.0.
This is a new mechanism specified by MQTT 5.0, which allows clients and
brokers for enhanced authentication in between CONNECT and CONNACK
exchange. An additional MQTT event (MQTT_EVT_AUTH) was specified which
is triggered when the AUTH packet arrives from the broker.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
55e1c10894 net: mqtt: Add MQTT 5.0 support for DISCONNECT
Add support for DICONNECT message specified in MQTT 5.0.
As with MQTT 5.0, the disconnect can now also be initiated by the
broker, it was needed to add decoder support for the message.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
2459ffae41 net: mqtt: Add MQTT 5.0 support for SUBACK/UNSUBACK
Add support for SUBACK/UNSUBACK messaged specified in MQTT 5.0.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
efd795b066 net: mqtt: Add MQTT 5.0 support for SUBSCRIBE/UNSUBSCRIBE
Add support for SUBSCRIBE/UNSUBSCRIBE messages specified in MQTT 5.0.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
c21e64251b net: mqtt: Add MQTT 5.0 support for PUBLISH ACKs
Add support for PUBACK, PUBREC, PUBREL and PUBCOMP specified in MQTT
5.0. As all of these acknowledgment packets have similar format,
introduced a common encoder/decoder to handle ACK packets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
15ad90aceb net: mqtt: Add MQTT 5.0 support for PUBLISH
Add support for PUBLISH message specified in MQTT 5.0. The message
encoder and decoder were updated to support MQTT properties.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
6038676b83 net: mqtt: Add MQTT 5.0 support for CONNACK
Add support for CONNACK message specified in MQTT 5.0, along with
property decoders required to decode MQTT properties. Decoded properties
are provided to the application within mqtt_connack_param structure,
accompanying the CONNACK event.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
8fe2965500 net: mqtt: Add MQTT 5.0 support for CONNECT
Add support for CONNECT message specified in MQTT 5.0, along with
property encoders required to encode MQTT properties which is a new
concept in MQTT 5.0. Connect and will properties can be specified by the
application in the mqtt_client structure before connecting.

Introduce a helper function which allows to verify whether MQTT 5.0 is
used or not, so that it's still possible to use MQTT 3.1 even if MQTT
5.0 support is enabled in Kconfig.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
1eb9a5c241 net: mqtt: Fix helper macro for encoded binary data length
The macro did not take into account the 2-byte binary data length
encoded before the actual binary data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
f31a45f57c net: mqtt: Add Kconfig to select maximum supported MQTT version
It should be possible to select maximum supported MQTT version, so that
for example MQTT 5.0 features can be compiled-out in case they're not
needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Håvard Reierstad
200628e8d0 Bluetooth: Mesh: Disable prov bearers on link
Previously, PB-GATT unprovisioned advs would continue being sent if a
device is provisioned or in the process of being provisioned (an active
provisioning link) over PB-ADV.

This commit introduces the `link_cancel` callback for the `prov_bearer`
struct. When a provisioning link is established over a prov bearer, all
other (active) prov bearers will be suspended through this callback, and
re-enabled when the link is closed. An exception is made for PB-REMOTE,
which can utilize the other bearers.

The call to `bt_mesh_pb_gatt_srv_disable` in settings.c is removed. This
is called in `mesh_commit`, and is not needed as this is only used
during boot, at which point the Mesh provisioning service has not yet
been enabled/registered, meaning the function does nothing.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-03-26 16:19:31 +01:00
Vinayak Kariappa Chettimada
1dfc53fd21 Bluetooth: Controller: Fix ull_hdr_get_cb for Peripheral role
Fix ull_hdr_get_cb() for advanced scheduling to return
ticks_slot for Peripheral role.

Relates to commit d6c3e04eb8 ("Bluetooth: Controller:
Central maximum data PDU size time spacing").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-26 16:19:19 +01:00
Tomasz Moń
75109707e3 usb: device_next: Do not add serial number without HWINFO
For many devices iSerialNumber is not required. The only device class
currently supported in Zephyr that requires iSerialNumber is MSC. If the
serial number is not available then iSerialNumber must be 0. Failure to
read the string descriptor for non-zero iSerialNumber fails USB Command
Verifier Chapter 9 tests.

When USBD_DESC_SERIAL_NUMBER_DEFINE() was used without CONFIG_HWINFO
then it did lead to runtime failure when requesting the string (thus
failing certification).

Fail USBD_DESC_SERIAL_NUMBER_DEFINE() at build-time if CONFIG_HWINFO is
not set to prevent the surprise at runtime. Only define serial number
descriptors if CONFIG_HWINFO is enabled.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-03-26 16:18:56 +01:00
Ivan Iushkov
ded9c1f44d bluetooth: CS: add bt_le_cs_get_antenna_path()
added function to calculate antenna path
based on the antenna permutation index and
total number of antenna paths

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2025-03-26 11:32:57 +01:00
Seppo Takalo
05abdf5d0b net: lwm2m: Deprecate LWM2M_ENGINE_MESSAGE_HEADER_SIZE
Kconfig value LWM2M_ENGINE_MESSAGE_HEADER_SIZE added
an extra headroom for CoAP packet sizes so that
if CoAP Block-Wise transfer block-size is configured
to be same as LWM2M_COAP_MAX_MSG_SIZE, the full
payload block would usually fit to the datagram.

This causes too much confusion to be usable.
CoAP headers and options vary on sizes, and there is
no runtime limitations that we should check the
header size against.

Only real limitation is the CoAP packet size, which
must fit into the UDP datagram with typical DTLS headers.

Only limitation for CoAP block-size then is that
it must fit into the CoAP message with all the headers
and options. But as the option sizes, like path, vary,
it must be checked runtime.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-03-26 11:32:23 +01:00
Pieter De Gendt
044a94f06a net: lib: coap: coap_server: Use eventfd instead of socket pair
Convert the socket poll logic to use a more lightweight eventfd file
descriptor instead of a socket pair.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-03-26 08:55:45 +01:00
Johann Fischer
21f4a7db60 usb: device_next: always reset endpoints to defaults on SetInterface
Disable/enable endpoints even if the new alternate is the same as the
current one, forcing the endpoint to reset to defaults.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-03-26 07:08:06 +01:00
Johann Fischer
87caef4389 usb: device_next: keep loopback function transfers going
Do not report canceled transfers as an error and continue the transfers
regardless of the previous transfer status.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-03-26 07:08:06 +01:00
Lyle Zhu
22ea55c7a0 Bluetooth: Classic: Move classic functions from conn.c to conn_br.c
Move functions `bt_sco_cleanup()`, `bt_conn_create_br()`,
`bt_hci_connect_br_cancel()`, and `bt_conn_get_dst_br()` from `conn.c`
to `conn_br.c`.

Change the function `bt_hci_connect_br_cancel()` to internal public
function.

Add a header file `conn_br_internal.h`. And declare the function
`bt_hci_connect_br_cancel()` in the header file.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-25 22:15:19 +01:00
Håvard Reierstad
c77587a76b Bluetooth: Host: Clarify use of identity in docs
Clarifies the use of identity in `bluetooth.h` by specifying whether the
documentation refers to the identity address, i. e. the actual address
`bt_addr_le_t`, or the identity handle, i. e. an index corresponding to
a specific identity address.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-03-25 22:14:55 +01:00
Hake Huang
1847b882a2 tests: ztest: enable ztest_no_yield for all in PM
if CONFIG_PM=y, board will enter low power,
which will cause problem for debugger.
So for ztest cases, we need enable this to avoid problem.
This used to apply to soc/platform level, now remove them.

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-03-25 22:14:20 +01:00
Troels Nilsson
e486a06f0b Bluetooth: Controller: Remove unneeded members from ull_hdr
Several members of the ull_hdr can be removed, saving 12 bytes
from all ULL instances used (and a bit of code as well)

ticks_active_to_start is always 0 and can be removed completely

ticks_prepare_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US), so replace usage
of it by this constant

ticks_preempt_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US), so replace
usage of it by this constant

In addition, remove logic handling usage of XON_BITMASK since it
was only used by the long removed legacy LL

Signed-off-by: Troels Nilsson <trnn@demant.com>
2025-03-25 22:13:58 +01:00
Troels Nilsson
a87e8dce7d Bluetooth: Controller: Fix lost_payloads calculation for FT > 1
The lost_payloads calculation in ull_conn_iso_start() could easily
end up negative for CIS with FT > 1; Add a check to avoid this

Signed-off-by: Troels Nilsson <trnn@demant.com>
2025-03-25 22:13:45 +01:00
Jukka Rissanen
f7d37ea87c net: ipv4: Add DiffServ DSCP code point definitions
Add DSCP defines for cases where the IPv4 packets need
classification.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-25 11:00:33 +01:00
Aleksandr Khromykh
928208cf36 Bluetooth: Mesh: to not set valid state if mesh is not valid yet
Commit sets valid state when mesh is actualy provisioned.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-03-25 11:00:22 +01:00
Seppo Takalo
15b0f9033b modem: cmux: Do not return error on low buffer space
If we end up writing zero bytes to cmux output, we can return
zero instead of -ENOMEM as it would break various modules when
using small buffers. For example modem_chat.c does not tolerate
-ENOMEM but handles zero OK.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-03-24 19:33:07 +01:00