Commit graph

22,555 commits

Author SHA1 Message Date
Lyle Zhu
0c2c93d57d Bluetooth: Classic: SCO: Modify bt_sco_chan::ops with const
Use `const` to modify the field `ops` of the structure
`struct bt_sco_chan`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-06-26 22:05:25 -05:00
Lyle Zhu
256e3a1879 Bluetooth: Classic: HFP_AG: Register SCO connect callback
There is an issue that the SCO connect cannot be un-referenced by HFP
AG when the SCO connection is broken if the SCO connect is not created
by HFP AG.

Register SCO connect change callback. And un-reference the SCO connect
in SCO disconnected callback.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-06-26 22:05:25 -05:00
Lyle Zhu
78a22f461a Bluetooth: Classic: SCO: Add SCO conn connected/disconnected cb
Add two functions to register/unregister SCO conn connected/
disconnected callback.

Add macro BT_SCO_CONN_CB_DEFINE to defined static SCO connect callback.
Define section `bt_sco_conn_cb` to ROM.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-06-26 22:05:25 -05:00
Lyle Zhu
0083d8e960 Bluetooth: Classic: HFP_AG: Improve the SCO management
There are two issues found,
Issue 1, if the SCO connection has been established, the SCO connected
event will not be notified. Then the call that waiting for the SCO
connected event will not be updated. And the call will be rejected due
to the timeout.
Issue 2, the SCO con object will be cleared when SLC is disconnecting
and the SCO connection has been established. It causes the SCO connect
object will be `NULL` in the SCO disconnected callback.

Add a new field `sco_conn` to keep the SCO connect object. Manage the
SCO connection via the field `ag->sco_conn`.

When creating the SCO connection, keep the created SCO connect object
to `ag->sco_conn`. And if the `ag->sco_chan.sco` is `NULL`, it means
the SCO connection has been established. Just update the call that
waiting for the SCO connected event directly.
Increase the `ref` of SCO connect object and pass to the field
`ag->sco_conn` if the `ag->sco_conn` is `NULL`.
Decrease the `ref` of SCO connect object if the `ag->sco_conn` is not
`NULL` when disconnect the SCO connection or process SCO disconnected
event.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-06-26 22:05:25 -05:00
Robert Lubos
8aa842c2c4 net: lwm2m: Prevent busy looping when active notify is set
In case a new notification is triggered while the previous one is still
active (i.e. not acknowledged), the LwM2M engine will start busy
looping, as the new notification is still valid (and supposed to be sent
after the previous one is done), but it's not sent in the current
iteration. The busy looping might prevent the system from receiving the
acknowledgment for the previous one, resulting in unresponsive system.

Fix this, by delaying the new notification timestamp a bit in such case,
so that the new notification will be scheduled for later instead of
trying to send it again right away.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-06-26 11:00:42 -05:00
Robert Lubos
a9c30d73f8 net: lwm2m: Implement gt/lt/st attributes handling
While it was possible to specify Greater Than / Less Than / Step
observe attributes for a resource, they were not taken into
consideration when evaluating notification criteria. This commit adds
support for checking if the resource value meets the value criteria
specified by gt/lt/st attributes.

Note that gt/lt attributes are thresholds - notification should only
sent if the resource value crosses them.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-06-26 11:00:42 -05:00
Robert Lubos
1bfd2ab4fd net: lwm2m: Update value of resources in notification registry
Update the value stored in the notification registry whenever
notification is sent (for those resources that have gt/lt/st attributes
assigned).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-06-26 11:00:42 -05:00
Robert Lubos
1ee6943cb5 net: lwm2m: Implement notified value registry for gt/lt/st attributes
Greater than, Less than and Step attributes require to track the last
notified value of a resource/resource instance in order to be able to
apply the specific thershold/step rules that the attributes define.

Therefore, implement a simple registry of the last notified values. When
one of the gt/lt/st attributes is configured on a resource/resource
instance, a registry entry is allocated for respective resource.
Whenever a notification is sent (either as a reply to Observe message,
or proactively) the registry is updated for the notified resources.

The stored resource values have been unified as "double" variables, to
avoid implementation complexity of having to support different
integer/floating point resource types.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-06-26 11:00:42 -05:00
Robert Lubos
46aaf287da net: lwm2m: Do not apply gt/lt/st attributes to incompatible resources
gt/lt/st attributes can only be applied to numerical resources according
to LwM2M specification (and common sense), hence verify that when
attributes are assigned.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-06-26 11:00:42 -05:00
Aleksandr Khromykh
b6a0f4e072 bluetooth: mesh: remove unused functionality
Commit removes unused host hci custom functionality
that was moved to mesh by misinterpretation of it.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-06-26 14:09:01 +02:00
Fin Maaß
da09ee1200 logging: fix storage size of 'tspec' isn't known
fix storage size of 'tspec' isn't known
struct timespec wasn't defined anymore.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-26 14:08:35 +02:00
Jukka Rissanen
f1a9ff97cb net: shell: dns: Print info about DHCP added servers
Print information which DNS servers were added by DHCP when
listing DNS servers in "net dns" command. This helps debugging
DNS server issues.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-26 14:08:19 +02:00
Jukka Rissanen
25084203c2 net: dhcp: Remove only added DNS servers when stopping
Make sure that we remove only the added DNS servers when
the DHCP is stopped.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-26 14:08:19 +02:00
Jukka Rissanen
cdc6c324d7 net: dns: Save info about source when configuring DNS servers
Remember which DNS server was added by a source like DHCPv4 or v6
message. This will allow system to remove DNS servers that were added by
that source. Then when stopping for example DHCP, we can remove those
specific DNS servers and not leaving DNS servers hanging in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-26 14:08:19 +02:00
Krzysztof Chruściński
0b9b6b4b85 debug: cpu_load: Fix overflow when measurement window is long
Use 64 bit values for accumulating idle time and measurement window
as it was possible to get overflow if window was long enough.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-06-26 14:07:12 +02:00
Duy Nguyen
c0926e5670 tests: interrupt_util: Update RX irq trigger method
The QEMU RX doesn't allow to write value to IR flag,
There is also mentioned in RX HWM that the IR should
not be write 1 to. So we change the method to trigger
interrupt here is to call directly to SW irq table

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-06-26 14:07:03 +02:00
Keith Packard
cecde08586 subsys/mgmt: Declare PROCESSOR_NAME for RX targets
Map the current set of RX CPU variants into descriptive names

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-26 14:07:03 +02:00
Keith Packard
4b1c96f377 subsys/debug: Stub out debug thread info for RX arch
This architecture is missing lots of support bits. Stub out this piece so
we can get more things building.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-26 14:07:03 +02:00
Aleksandr Khromykh
b408445b4d bluetooth: mesh: remove tinycrypt support
Tinycrypt support deprecated in Zephyr 4.0 release.
Time to remove it.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-06-26 11:13:19 +02:00
sudarsan N
654e690057 settings: zms: fix out-of-bounds null terminator write
Previously, zms_read() could fill the buffer up to sizeof(rdname),
leaving no space for the null terminator, which could cause an
out-of-bounds write.

This change reduces the read size to sizeof(rdname) - 1 and appends
a '\0' manually, ensuring the buffer is always null-terminated safely.

Fixes: CID 516244
Fixes: #90533

Signed-off-by: sudarsan N <sudarsansamy2002@gmail.com>
2025-06-26 11:12:49 +02:00
Nirav Agrawal
5a8189bf2a bluetooth: host: gatt: fix null-ptr access if no include-svc userdata
- Issue: There is a bus-fault while accessing empty userdata structure
  pointer if application does not include any include service
  userdata instance (which consist of UUID list of included service)
  but service array has defined dummy entry for it assumed to be
  overridden by app during initial flow.
- For example, the issue has happened in case of tmap-central sample
 without "CONFIG_BT_OTS" support. there are some MCS attributes
 dependent on OTS service because of that
 "BT_GATT_INCLUDE_SERVICE(NULL)" entry is added as part of service
 definition. The given entry does not have userdata handler defined
 and is expecting to be overriden by the app if it will be included.
 During "bt_mcs_init()" call, "mcs.attrs[i].user_data" is not
 populated with any attr-instance pointer. This makes CPU to access
 null-address during reading local-database include-service attribute
 which was not provided by the app but the include-service entry was
 added to the db.
- Fix: Adding condition to check if user-data has null address, and
 returning back to avoid any hard-faults.

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
2025-06-25 15:51:24 -10:00
Ravi Dondaputi
d289bed4af net: lib: wifi_credentials: Add support for Enterprise security
Add support for configuring enterprise mode security.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2025-06-25 15:31:29 -10:00
Kristoffer Rist Skøien
ca2e98c4c9 debug: Added CPU usage callback
- Added a CPU load callback with threshold
- Changed cpu_load to use k_timer instead of k_work

Signed-off-by: Kristoffer Rist Skøien <kristoffer.skoien@nordicsemi.no>
2025-06-25 15:29:06 -10:00
Pieter De Gendt
0b8c00b5dd net: lib: dhcpv4: Support INIT-REBOOT
Add the init-reboot state for DHCPv4 to request an already assigned IP
address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-25 14:09:46 +02:00
Pieter De Gendt
99a2893713 net: lib: dhcpv4: Skip leftover hostname or domain name bytes
When reading and printing hosname or domain name from DHCP options, we need
to skip the leftover bytes that do not fit into the provided buffers.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-25 14:09:46 +02:00
Pan Gao
e53ceeb86b net: l2: wifi: fix ap rts_threshold cmd parameter count
fix the number of mandatory arguments for command Wi-Fi ap RTS threshold,
3 to 2.

Signed-off-by: Pan Gao <pan.gao@nxp.com>
2025-06-25 10:53:40 +02:00
Paul He
f7979f6deb mgmt: mcumgr: remove redundant arguments for zephyr_library
No argument is needed for zephyr_library and a directory-inferred name will
be generated by default.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2025-06-24 20:11:27 -10:00
Koen Van Herck
6ccd228d62 subsys/tracing: do not select (RTT_)CONSOLE in SEGGER_SYSTEMVIEW
Tracing using Segger's SystemView works fine without enabling RTT_CONSOLE
(or CONSOLE, in general).
SEGGER_SYSTEMVIEW was automatically selecting RTT_CONSOLE, which prevents
applications from using another console backend (e.g. UART_CONSOLE).

Signed-off-by: Koen Van Herck <koen.v.herck@gmail.com>
2025-06-24 20:04:07 -10:00
Marc Lasch
86dbcd2cf2 net: lwm2m: Make Bootstrap on Registration Failure configurable
The fallback to Bootstrap on a Registration Failure might not be desirable
for some applications. This change makes the default behavior configure
through Kconfig.

An alternative to configure "Bootstrap on Registration Failure" would be to
set the server object resource id 16 at runtime. However, this is tedious
and error-prone, as it will be reset when the server object is deleted and
might have to be set at different locations in the client code.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2025-06-24 15:38:27 -05:00
Marc Lasch
4c46b0bc8b net: lwm2m: Fix typo in bootstrap_on_fail
Bootstrap vs. Boostrap.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2025-06-24 15:38:27 -05:00
Vinayak Kariappa Chettimada
fe348bce8e Bluetooth: Controller: Fixup ticker reschedule with drift
If the next ticker is too close then hop over it when
rescheduling a ticker with drift in slot window is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-06-24 15:35:51 -05:00
Emil Gydesen
4adabb49da Bluetooth: BAP: Use IN_RANGE in bt_bap_base_get_base_from_ad
This simplyfies the checks in the function a bit, and makes
Sonarcloud happy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-24 15:34:17 -05:00
Emil Gydesen
c8ac20f2b2 Bluetooth: Audio: Add missing default case for bt_audio_dir_str
The switch was missing a default case as per the coding
guidelines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-24 15:34:01 -05:00
Emil Gydesen
ae6b33be07 Bluetooth: CSIP: Remove excess + at start of link for test_k
Removed the excess +.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-24 15:33:41 -05:00
Chris Friedt
03db50b79d net: remove dependency on posix for iso c time() function
The ISO C function time() should not depend on POSIX and this was
corrected recently via the common libc time() implementation.

Remove this dependency from the network subsystem where it has
been unduly needed for some time.

Similarly, XSI_SINGLE_PROCESS was a dependency for time() via
picolibc, because the time() implementation in picolibc relies
on the POSIX gettimeofday() call.

However, since Zephyr's common libc time() implementation no longer
depends on that, it can be removed as a dependency in the network
subsystem as well.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Chris Friedt
7868b4d54d logging: use sys_clock_gettime()
Use the newly added sys_clock_gettime() to avoid the unnecessary
dependency on POSIX APIs.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Bjarki Arge Andreasen
ce95b7033c pm: device_runtime: fix unbalanced domain get/put
pm_device_runtime has inconsistent behavior regarding
getting and putting a device's domain. This commit
aligns it to get the domain only once, once device
is resumed, and put only once, once device is
suspended.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-06-24 09:14:20 +02:00
Benjamin Cabé
13ec1ea3dd Bluetooth: controller: update non-inclusive language
use "Accept List" terminology instead of white list

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 16:31:16 -05:00
Benjamin Cabé
6a893fb91b settings: zms: add missing error check
Add a missing assignment of the return value of zms_write() to rc
variable so that potential error is actually checked and returned.

Fixes CID 524778
Fixes zephyrproject-rtos/zephyr#90474

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 12:49:07 -07:00
Johan Hedberg
58fe2ab5e6 Bluetooth: Mesh: shell: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
3056d0773e Bluetooth: Host: shell: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
896212933a Bluetooth: Host: scan: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
e9f06126ea Bluetooth: Host: iso: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
354e75d479 Bluetooth: Host: id: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
6f2643638d Bluetooth: Host: direction: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
e23d5a0801 Bluetooth: Host: cs: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
0d47556542 Bluetooth: Host: conn: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
fa0aece2fa Bluetooth: Host: Classic: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
47fa056fb6 Bluetooth: Host: adv: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Johan Hedberg
2ea9605380 Bluetooth: Host: core: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00