The function should stop iterating if the callback provided to
bt_cap_unicast_group_foreach_stream returns true.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement the function bt_bap_broadcast_source_foreach_stream that
allows users to iterate on all BAP streams in a BAP broadcast source.
This can be used to easily get reference to other broadcast streams in
the same group as any other stream via the stream->group pointer
or a broadcast source pointer directly.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
We already have bt_conn_tx for outgoing buffer user data, so name the
struct for incoming (rx) buffers similarly. Also, update ISO to use this
struct instead of a custom iso_data struct, since the content and purpose
is identical.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Removes the BT_LE_ADV_OPT_USE_NAME and BT_LE_ADV_OPT_FORCE_NAME_IN_AD
advertiser options and related flags, macros and functions. The
application now needs to include the device name explicitly.
The API was deprecated in
https://github.com/zephyrproject-rtos/zephyr/pull/71700
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Disable the data interface when the device is disconnected or when the
CDC-NCM and CDC-ECM instances are disabled for any reason.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Fix an issue where IPV6_RECVPKTINFO was used instead of IPV6_PKTINFO
when insert_pktinfo was called.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Add IP_RECVTTL or IPV6_RECVHOPLIMIT BSD socket options
that can be used to extract ttl/hop limit from ancillary data
in recvmsg() call.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
In a call to pm_device_runtime_get, if the power domain is taken but
action_cb fails, the power domain is not released.
Signed-off-by: Adrien Lessard <adrien.lessard@rbr-global.com>
Removed the LOG_WRN if the started or stopped callback
for streams are not set. The reasoning is that there is also
the group-wide started and stopped callbacks, and an application
may want to use those instead of the per-stream callbacks.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the LOG_WRN if the started or stopped callback
for streams are not set. The reasoning is that there is also
the group-wide started and stopped callbacks, and an application
may want to use those instead of the per-stream callbacks.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_bap_unicast_client_ep_qos function attempts to access
ep->iso->chan.iso->iso, but where some of the pointers may be
invalid. Add an additional check for these.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In addition to aligning the destination address of all connection
objects during the identity resolution phase, we also need to update the
corresponding address field in the `struct bt_keys` structure for each
of these connection objects.
If we don't do this, `bt_keys_get_type` for that connection won't find
the `bt_keys` structure in the pool and will allocate a new one. This
will result in orphaned `bt_keys` structures in the pool.
This completes the change done in https://github.com/zephyrproject-rtos/zephyr/pull/61030/commits/637dabc3c9b018f47dee656d2ca0fe8f2fa21984
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The event header is already accessed in `bt_recv_unsafe`. If length is
valid there, no point in checking it again in `hci_event` or
`hci_event_prio`.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
During debugging multiple.sh test, a race condition was observed where
advertiser state on Host and Controler was desynchronized.
Below is the sequence of actions led to this issue:
0. Host has queued few priority events at this moment.
1. Controller establishes a connection and stops the advertiser.
2. Controller sends to Host BT_HCI_EVT_LE_ENH_CONN_COMPLETE.
3. Host deprioritizes BT_HCI_EVT_LE_ENH_CONN_COMPLETE event and doesn't
process it immediately.
4. Controller sends to Host other priority events which are processed
immediately.
5. Host wants to disable the advertiser in order to update the Resolving
List (see `bt_id_add`).
6. Host sends to Controller BT_HCI_OP_LE_SET_ADV_ENABLE(Disable)
command.
7. Controller sends to Host BT_HCI_EVT_CMD_COMPLETE event on
BT_HCI_OP_LE_SET_ADV_ENABLE command.
8. Host prioritizes this BT_HCI_EVT_CMD_COMPLETE event, processes it
immediately and clears `BT_ADV_ENABLED` flag for the advertiser.
Note that Controller already has the advertiser disabled after
establishing connection on step 1.
9. Host sends few commands in a row and Controller sends
BT_HCI_EVT_CMD_COMPLETE events that are prioritized (see
`bt_id_add`).
10. Host wants to re-enable the advertiser after updating the Resolving
List.
11. Host sends to Controller BT_HCI_OP_LE_SET_ADV_ENABLE(Enable)
command.
12. Controller sends to Host BT_HCI_EVT_CMD_COMPLETE event on
BT_HCI_OP_LE_SET_ADV_ENABLE.
13. Host prioritizes this BT_HCI_EVT_CMD_COMPLETE, processes it
immediately and sets `BT_ADV_ENABLED` flag for the advertiser.
14. Controller has the advertiser enabled.
15. Host now processes the delayed BT_HCI_EVT_LE_ENH_CONN_COMPLETE
event.
16. Host resets the advertiser state, thinking the Controller's
advertiser is also stopped.
This commit prioritizes LE Connection Complete and LE Enhanced
Connection Complete events to drop advertiser state on Host immediately
once the corresponding event was received.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
- "bt_tbs_set_uri_scheme_list()" function does not setting URI for
GTBS instance. Using "inst_lookup_index()" fixes issue to find
registered GTBS instance for provided bearer_index.
- "bt_tbs_set_uri_scheme_list()" function overrides URI scheme list
with latest provided list. But the expectation is that it should
keep previously added URI schemes and only update new scheme which
are not part existing list. Code is updated to fix this.
- The same function uses net-buf to combine all URI schems for all
TBS bearer if current request is not for GTBS instance. Currently,
the code only uses combined URI scheme list for logging purpose and
it is not used to send for URI Scheme notification to provide
updated GTBS URI scheme to remote. Code is now updated to add
dynamic buffer to add all TBS URI scheme list for GTBS instance
and notify it similar to other functions to optimise memory usage.
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
If the chrc->uuid is somehow an invalid UUID, we log it and
terminate the discovery procedure.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some TBS API functions attempted to take the mutex
of an instance before the NULL check.
Reorder the checks of the functions, and also modify function
to be more similar (using the same terms and structure).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There are two main issues found with using DLC TX thread,
Issue 1, the RAM consumption. Every DLC will have a dedicated thread
and thread stack.
Issue 2, the thread stack overflow issue. There is no way to strike a
balance between stack size and RAM consumption. Since the deep of call
stack is depended on the upper layer, the thread stack needs to set by
application. Due to the thread stack of DLC is dedicated, RAM
consumption is the product of the added value and the number of DLCs.
Use a TX worker to replace DLC TX thread.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When the `PTP_UDP_IPv6_PROTOCOL` configuration is enabled
the `mcast_addr` variable is defined as an IPv6 structure, which
doesn't have `s_addr` member.
To not introduce preprocessor guarded code blocks in functions
added union to represent both configurations: IPv4 and IPv6.
Fixes: #92975
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add a Kconfig `BT_L2CAP_CONNLESS` to enable the feature.
Add an API `bt_l2cap_br_connless_register()` to register the monitor
to receive the unicast connectionless data.
Add an API `bt_l2cap_br_connless_unregister()` to unregister the
registered callbacks.
Add an API `bt_l2cap_br_connless_send()` to send unicast
connectionless data.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
A logging module named `tls_credentials` was being declared, but no
other source module was creating and registering it. Do the registration
in the file to fix the compiler error.
Signed-off-by: Jordan Yates <jordan@embeint.com>
It might come in handy to filter the output of a device list
command, by adding a filter (auto-completion enabled as well).
Such as:
$ device list uart
devices:
- uart@2f8 (READY)
DT node labels: uart1
- uart@3f8 (READY)
DT node labels: uart0
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Co-authored-by: Dimitris Karnikis <dika@bang-olufsen.dk>
Co-authored-by: Hans Binderup <habi@bang-olufsen.dk>
It might come in handy to access non-initialized devices throuhg the
shell. I.e. devices which 'zephyr,deferred-init' DTS attribute was set.
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
It is actually easy to have device name going beyond 20 characters.
There is a maximum defined internally, better using it.
Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Allow changing delays via Kconfig values.
Use identical delay (`SHELL_MQTT_WORK_DELAY_MS`) for connect, subscribe and
process work instead of varying 1 or 2 second delay.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Implement the unicast to broadcast handover procedure,
as per the Bluetooth CAP specificiation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Changed the number of mandatory options of `rts threshold` to 1, so as
to allow no arguments for querying.
Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
This allows the software secure enclave to be changed to a
different implementation, which currently is not possible
Signed-off-by: Jamie McCrae <spam@helper3000.net>
If webserver uses custom socket creation,
and it's family is AF_UNSPEC, net_sprint_addr will return NULL,
which leads to LOG_DBG crashing with busfault.
Add NULL check for that.
Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
The NET_CONN_LOCAL/REMOTE_PORT_SPEC flags were set on the connection but
not really used. At the same time, when remote address was being
cleared, only the flag was unset, but the actual port number left
intact. This could lead to false port comparisons when remote address
was cleared from the connection context.
In order to avoid that, use the NET_CONN_*_PORT_SPEC flags to determine
whether to compare local/remote ports instead of checking the port value
right away (which may not be valid anymore if the flag is unset).
Also align with MISRA rules when comparing flags in other cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>