create internal bt_a2dp_init_req and bt_a2dp_init_ctrl_req to init `req`,
then the `req->status` will not be forgotten to be cleared as 0.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Due to the flag `BT_HFP_HF_FLAG_CLCC_PENDING` is set when receiving
the +CIEV or +CIND notification, the command `AT+CLCC` will be
pending due to the flag is not cleared.
Add a flag `BT_HFP_HF_FLAG_INITIATING` to indicate the HF
initialization is ongoing.
Add a flag `BT_HFP_HF_FLAG_QUERY_CALLS` to indicate the current calls
list needs to be queried.
Set the flag `BT_HFP_HF_FLAG_INITIATING` at the beginning of the HF
initialization. Set the flag `BT_HFP_HF_FLAG_QUERY_CALLS` instead of
setting the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if the current calls
list needs to be queried and the flag `BT_HFP_HF_FLAG_INITIATING` is
set.
After the HF initialization is done, query list of the current calls
by calling the function `hf_query_current_calls()` if the flag
`BT_HFP_HF_FLAG_QUERY_CALLS` is set.
Set the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if it is not set in the
function `hf_query_current_calls()`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add test case that validates behavior of pm_policy_state_all_lock_get
and pm_policy_state_all_lock_put.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add function for getting and putting a lock for all power states.
It is much faster version of requesting 0 us latency with actual
intention to disable all power states.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Optimise the PPP frame wrapping process by performing all work inside a
single function into a contiguous buffer, instead of operating on the
ring buffer one byte at a time.
On a nRF54L15 (M33 @ 128 MHz) before the change:
```
Wrapping 1062 byte packet: ~4.1 ms
Wrapping 1355 byte packet: ~5.0 ms
```
After the change:
```
Wrapping 1026 byte packet: ~2.4 ms
Wrapping 1341 byte packet: ~3.1 ms
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
Fix additional space in active receive states.
Add additional information when logging duplicate
broadcasts.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When cap_commander_broadcast_reception_start is called during the
handover, the failed_conn was not correctly.
It is now being set by cap_commander_broadcast_reception_start
and if that is called via handover, it will be correctly set.
If it is called via bt_cap_commander_broadcast_reception_start
then it will be cleared in case of error.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There are some cases when OpenThread opens a sockets and doesn't choose
as default it's internal interface, this leading to usage of
platform UDP module which will then send back the packet to the
OpenThread interface. In this case, the packet should not be treated as
originated from backbone interface.
Backbone router multicast listener callback functionality is improved.
A route with a prefix length of 128 is set
and a multicast address is added for each listener registration.
OpenThread interface joins that multicast address group.
Enabled forwarding capabilities for Backbone interface.
A border router should be able to perform default packet forwarding for
destination addresses with a multicast scope greater than admin-local.
In order to achieve this, multicast routes have been added to those
addreses. [https://datatracker.ietf.org/doc/rfc7346/]
For Border Router application, `ip6_addr_cb` is not installed.
otIp6SubscribeMulticastAddress call would re-register an IPV6 multicast
address which might have been registered by an OpenThread node using
`ipmadd add` command and even if that node performed `ipmaddr del`,
the address was still present in multicast listener table. This also
led to a missing MLDv2 message with that specific multicast IPV6
address.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Introduce `lwm2m_set_cache_filter()` so applications can drop cached
samples before they reach the LwM2M SEND path.
Fixes#91590
Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
Invalid header length and cause an integer overflow in
bt_br_acl_recv leading to undesired behavior.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Changes the link close upon success to use the `prov_link_close` helper
function instead of doing it manually, as minor cleanup.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
According to MshPrt 5.4.4, The Provisioner, upon receiving the
Provisioning Failed PDU, shall assume that the provisioning failed and
immediately disconnect the provisioning bearer.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
Implement idle timeouts, primarily in the common connectivity library,
with individual interfaces notifying the library when the interface has
been used.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add an interface idle timeout parameter to the connectivity
binding structure. This will be used to track idle timeouts for
interfaces.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add KConfig LOG_BACKEND_SWO_SYNC_PACKET to allow disabling SWO
synchronization packets. Useful if the SWO is used as a UART replacement
to avoid that the sync packets show up as special characters in a terminal
application.
Signed-off-by: Fabian Otto <fabian.otto@rohde-schwarz.com>
Move the call to bt_iso_reset to before bt_conn_cleanup_all.
The reason for this is that bt_conn_cleanup_all will disconnect
all the ACL connections, which will put the CIS in a disconnecting
state, without finalizing them.
This means that if we get a num_completed_packet event between
the call to bt_conn_cleanup_all and before the BT_HCI_OP_RESET
request has been completed, we will trigger an assert in the
hci_num_completed_packets function as the CIS still exists,
but where we would already have cleaned up the pending TX
without telling the controller.
Moving the call to bt_iso_reset means that the CIS will have
been fully terminated at this point, which will prevent
the assert from happening. Since CIS depends on ACLs, this
is also the logical order for resetting them.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes an issue in a board using ethernet that faults with the
default 512 byte size by doubling the default to 1KiB. The actual
size of the thread depends upon the device and application
configuration so needs to be fine tined for each application
anyhow
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This doesn't try to optimize memory usage for QOS=-1 publications, because
it's easier to use existing structs and allocators instead of adding new
ones with less fields.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
The publish and subscribe APIs allocate topics implicitly, but don't
support allocating predefined or short topics. Additionally, we don't want
to force using short topics in case the passed topic is 2 bytes long, in
case the user doesn't want that (e.g. because the server doesn't support
it).
So instead, we add a new API which works similar to
mqtt_sn_predefine_topic, which allows allocating a short topic before using
any of these APIs.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
- These are independent from connections since they are always valid.
- Implicitly created topics(e.g. from publish or subscribe) can't be
deleted either, so that doesn't make things worse compared to those.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
add static for functions and variables.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 1282bf7b8d814ef7a217c6f0c424aa4b2f34d363)
use the sizeof of struct or variable; use macro to do the data shift.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit d6d567355d08cefd1e11d88563fc300928af4972)
In the cmd result callback, save the configuration to stream if result is
success.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 9a9477fa0214f245a66e24a2edd90132293d5086)
get the avdtp error code based on Zephyr err code to make the codes more
clear.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 1d4d97fdb41791501eb63934f096bcc88cb2da81)
If the previous cmd req is triggered, the cmd fail to trigger again and
keep the previous cmd req.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit f4197d51b62799748a75c97bd0b68778185ff293)
The `a2dp` is got by `req` through CONTAINER_OF, then the if always is
true.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 24ef59d835c69a30fe8a8e6569405791532d9e0d)
avdtp defines the data format by struct, use it to fill net buf.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit a89f4eddac6f13f981f2ca0b94f07edaad104afa)
check the buf tail room before adding data to buf.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 65f8a9e03baf899684198e707170ad17817f7ce5)
In current implementation, the SLC connected event will be early
notified. It causes the SLC state of AG is not aligned with the state
of HF.
The SLC connected event should be notified after the procedure of HF
indicators is done if the HF indicators feature is supported by both
devices.
Do not notify the SLC connected event after the AG has successfully
responded with information about how call hold and multiparty services
are supported if the HF indicators feature is supported by both
devices.
Notify the SLC connected event after the procedure of HF indicators is
done.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The address resoution from RFC6763 is generally a PTR, SRV, TXT, and
an A or AAAA. Records, so this change is mainly to start drawing a
clear functional change between the DNS query shell and the DNS
service shell that should be more of a "avahi-browse" or "dns-sd"
functional style.
So, this is not a very robust implementation since it is a chain of
queries when the goal should be to get additional records from the
message itself but those changes can be added iteratively.
Basic point of this change is to show the procedure for the "browse"
- PTR service resolution
- SRV query from the result of the PTR
- AAAA (or A) from the result of the SRV
TXT records are ignored for now but should be added into this as
additional record support is extended.
Signed-off-by: Charles Hardin <ckhardin@gmail.com>
The CMSIS-RTOS specification says "The function returns the event flags
stored in the event control block".
In the original code, osEventFlagsSet() called k_event_post() and then
k_event_test(). It worked mostly fine if the thread has higher priority
than the waiter thread. In the opposite case, the event was not reported
to the user.
With the last changes, the waiter thread use k_event_wait_safe(). So, the
event is posted and consumed in an atomic way. So, the issue above happen
even if the waiter thread has a lower priority then the poster.
This patch fixes the both cases.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
The CMSIS-RTOS specification says "The function returns the event flags
before clearing".
In the original code, if another thread set an event between k_event_test()
and k_event_clear(), there was a risk the function clear a flag without
reporting it to the caller:
T1 T2
k_event_test(..) == 0 ...
... k_event_post(.. 1)
k_event_clear(.. 1) ...
return 0 (while event 1 has been cleared)
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
In osEventFlagsWait(), if an event raises after the call to k_event_wait()
and before the call to k_event_clear(), we may clear it while it is not
going to be report to the caller.
Reported-by: Rahul Gurram <rahul.gurram@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Coverage options deserve their own kconfig, otherwise the testsuite
Kconfig will be very crowded and difficult to read.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make sure to consider both the new peripheral and central Kconfig options
when calculating needed TX buffers.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The BT_AUTO_PHY_UPDATE option was problematic in the sense that it didn't
really allow any kind of fine-tuning of what automation is desired. In
particular, it didn't allow specifying which PHY was the preferred one (it
was hardcoded to 2M) and also didn't allow specifying role-specific
(central vs peripheral) preferences.
To solve this, deprecate the old option, and instead introduce
role-specific options that allow specifying 1M/2M/Coded/None as the
preference. The new options have slightly different defaults than the new:
for central role 2M stays as the preference, however since it's uncommon to
require automated changes on the peripheral side the default is set to
None there.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
bt_conn_get_info API is used to retrieve connection-related
information. However, bt_conn_get_info sends the HCI command
BT_HCI_OP_READ_ENCRYPTION_KEY_SIZE to retrieve current
key_size, causing excessive blocking time.
Signed-off-by: Xiang Liu <liuxiang18@xiaomi.com>
Along with key-value pairs, add an option to dump vendor values as a
blob, use can choose either one or both.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
when ep is configured, the ep is used by the avdtp session, so combine
them together when ep is configured.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
ep->stream is cleared when stream l2cap is released, it should not be
cleared by close and abort cmd procedure.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
When signal l2cap is disconnected, use `release_work` to release the
related stream l2cap connections. When releasing the sep's stream l2cap,
use `delay_work` to check the stream l2cap disconnecting result.
Move the stream l2cap disconnecting callback to sep because the chan is
in sep, then use this callback to indicate the sep stream chan is
released and sep is idle.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>