The bt_debug_dump_recv_state did not care if the receive
state being dumped to log was active or not, and if it was
not actice, then it may just contain random data.
Added a check to see if it was active.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The cap_initiator unicast_stop command will now stop
all streams by default, without supplying the "all" argument.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some part of the descriptions were wrong. Also, the description of
`BT_BUF_ACL_RX_SIZE` was too verbose and no longer needed with the
updated L2CAP documentation.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The buffers for the PBP advertising data as well as the
buffers for the BASE periodic advertising data were
not cleared, so calling the functions multiple times
would simply append the data rather than just setting
the new data.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There are devices that will send empty SDUs instead of
empty PDUs, and while that should be harmless, it is nice
to know what is going on, and we may want to deal with
empty SDUs and empty PDUs differently.
This also modifies the state for TS and PSN to only be
applied for valid ISO packets.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
It is a common occurance that a specific type is not
found in the codec configuration, and the main way of
knowing that is by calling the function.
The debug log does not help debug anything (as it does also
return a specific error code), but rather just clutters up
the log if enabled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When returning an error code directly to an application
in the API, it should not log as a warning or error.
The lack of PAC records is also reported directly to the
application, and is not an error (in fact it is valid not to have
e.g. sink or source pacs).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add printing of the broadcast ID and whether an existing PA
sync was found in the bap_broadcast_assistant_recv_state_cb
function.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bap_broadcast_assistant mod_src command can now take "unknown"
as a value to supply BT_BAP_PA_INTERVAL_UNKNOWN to the scan
delegator.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The documentation for the command
bap_broadcast_assistant broadcast_code
was incorrect and has been fixed.
Additionally, and example of the command has been added
in the shell documentation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When a PA is synced via PAST, the receive state does not
have a PA sync object, and the address and SID must be
used.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The audio configuration 5 is defined to have 2 sink channels
per stream and 1 source channel per stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If pa_sync_past returns 0 then that means we are ready to
sync to past, and the BT_BAP_PA_STATE_INFO_REQ state should be set.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds the CAP Commander Change Microphone Mute procedure.
This procedure changes the microphone mute state on one or more
CAP Acceptors.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added a check for checking duplication when adding a source in the
broadcast assistant, as per requirement in BAP 6.5.4. It is not
permitted to add a source such that a combination of broadcast_id,
adv_sid and address type would result in same triple of values.
Added a recv_state struct to cache these values when read, and moved
past_avail and srd_ids into this as well.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
For BR/EDR L2CAP, if the function bt_l2cap_br_chan_send_cb
instead of bt_l2cap_chan_send is called, the ACL conn and
L2CAP chennel status will not be checked.
Check conn/channel status before sending data in
function bt_l2cap_br_chan_send_cb.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Change the receive workque name to "BT RX WQ" to distinguish it from the
receive thread, and the long workque one to "BT LW WQ" to make the
format consistent with the other Bluetooth threads.
On an nRF52 now "kernel stacks" looks like:
0x200016c8 BT RX (real size 448): unused 280 )
0x20001780 BT RX pri (real size 448): unused 224 )
0x200012c0 BT RX WQ (real size 2240): unused 1360 )
0x20001208 BT TX (real size 768): unused 408 )
0x20001130 BT LW WQ (real size 1344): unused 408 )
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Added a check for duplication of add source operation in the Scan
Delagator. BAP 6.5.4 states that an assistant may not perform add
source operation if it results in a duplication of a source. While
this is not mentioned for the Scan Delegator, the spirit of the spec.
must be that no duplications can exists in the recv_state, which is
what this commit fixes.
Signed-off-by: Fredrik Danebjer <frdn@demant.com>
This commit removes `bt_hci_evt_get_flags`, and the associated flag
symbols. These symbols no longer serve a purpose in the driver interface
after the removal of `bt_recv_prio` from the interface.
The implementation of `bt_hci_evt_get_flags` is distributed to its
still-existing use sites, `hci_core` and the `hci_driver` in the
controller.
The duplication of code is intentional. This is no longer part of any
interface, and the host-developers expect the host copy of the function
to change or dissapear entierly. This will allow the host implementation
to progress without fear of breaking the controller implementation.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Remove `bt_recv_prio` from the HCI driver interface. It's primary
purpose was to be used in conjunction with `CONFIG_BT_RECV_BLOCKING`,
which has been removed.
`hci_raw.c` provided a adapter implementation to make drivers
implementing the `CONFIG_BT_RECV_BLOCKING` interface useable with
`CONFIG_BT_HCI_RAW`. But since `bt_recv_prio` is being removed from the
HCI driver interface, drivers needing the adapter should copy the
adapter implementation as private internals.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This config selects a variant of the HCI driver interface that spills
out host internals unto the drivers and even the Zephyr controller. It
will now be removed in favor of driver interfaces that hide the
internals of the host.
The new default is `CONFIG_BT_RECV_WORKQ_BT`.
Any references to the removed kconfig are refactored out.
Any out-of-tree driver using the removed interface can be easily adapted
by copying the following implementations into the driver as private
functions:
- `hci_driver.h:BT_HCI_EVT_FLAG_RECV_PRIO`
- `hci_driver.h:BT_HCI_EVT_FLAG_RECV`
- `hci_driver.h:bt_hci_evt_get_flags`
- `hci_raw.c:bt_recv_prio`
In combination these symbols function as a interface adapter. These
symbols will be removed in this PR in subsequent commits.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Check max_tx_octects and max_tx_time are in the valid range, according
to the BT Core spec 5.4 [Vol 4, Part E, 7.8.46]
Fix#70472
Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
Commit prevents updating replay protection list on any frame came
from the network layer.
Replay protection cache is updated only if
- transport handles transport command without errors
- access layer handles model message without errors
- transport frame has correct length
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Commit adds analyzing of returned status of element rx.
If at least one element receives multicast message then
access layer will return suceess status.
If option CONFIG_BT_MESH_ACCESS_LAYER_MSG is enabled then
access layer will return success always.
Function bt_mesh_access_recv has been introduced to cover
case when real model statuses should be returned over
oppcode aggregator model despite access returns success.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Enables compatibility of NUS for codebases that are not
Bluetooth-centric (e.g: Non-bluetooth samples that use UART over
Bluetooth LE for Console, Logging, Shell, others).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Enables usage Bluetooth LE GATT as a serial endpoint to exchange data
using UART APIs. This implementation is compatible with UART Interrupt
Driven APIs and uses the nus-uart device-tree node properties to
configure FIFO buffers for transmitting and receiving. Defining
multiple instances of the driver is possible and it allows implementing
multiple GATT NUS service instances to exchange data as separate serial
endpoints.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
NUS is implemented as a Bluetooth LE service, exchanging data treating
the NUS characteristics as Serial endpoints: RX characteristic to
receive, TX characteristic to send binary packets.
This implementation also enables the ability to define multiple
instances of the NUS Service, analogous to mutliple serial endpoints,
to use each one for different purposes. Unless disabled through Kconfig,
NUS instantiates a default instance, similar to what other services do,
which allows users not interested in using multiple instances, to not
worry about the inherent complexities.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Recently (during Bluetooth UPF), a lot of developers experience
confusion due to weird errors in SMP, etc, which are actually irrelevant
and caused by the connection never having existed.
As a stop-gap measure, until upper layers properly report lower layer
failures, add a warning in the logs to stop wasting developer time.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Since the cap_common.c rely on CONFIG_BT_MAX_CONN, and is
only used for connected procedures, it should be guarded
by CONFIG_BT_CAP_INITIATOR_UNICAST instead of
CONFIG_BT_CAP_INITIATOR
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Increase the timeouts to be 60 instead of 6.
The reason for this is that some controllers (like the Zephyr
controller) will reserve some of these to ensure stability,
and in fact with skip = 5 and retry = 6, it would still
send the PA reports at every interval.
To accomodate a higher timeout value, the functions used to
convert PA intervals to PA timeouts have been updated.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There is no need to validate stream_param->data if it is NULL.
Fixes failing PTS BAP/BSRC test cases.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Remove SCO security management code block.
Currently, security related checks are not
necessary. It can be added if needed.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Call bt_sco_server_register to register SCO
server. Manage the SCO connection request.
Get SCO connect/disconnect status via SCO
channel ops.
Notify the uppper layer of the SCO connection
status changes through bt_hfp_hf_cb::
sco_connected and bt_hfp_hf_cb::
sco_disconnected.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Currently, SCO connections and disconnections
are agnostic to upper-layer.
Add two functions, bt_sco_connected and
bt_sco_disconnected, to notify the SCO
connect changes.
For Central side, pass "struct bt_sco_chan"
object when calling bt_conn_create_sco. it
uses to manage the SCO channel for upper-
layer.
For Peripheral side, two functions
bt_sco_server_register and
bt_sco_server_unregister are added to monitor
SCO connection request for upper-layer. The
upper-layer could accept or reject SCO connect
When the connection request received. If the
connect is accepted, the "struct bt_sco_chan"
object could be passed by "sco_server->accept".
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The codecs used for the bap bt_bap_stream_config was only
valid for the lifetime of the procedure, which meant
that by the end of the procedure the stream->codec_cfg
became invalid.
This is fixed by using the pointer provided to the
CAP API, and documentating the lifetime of the codec_cfg.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When calling `mesh prov beacon-listen on` shell command before
provisioning the local device, the stack won't report unprovisioned
beacons. This is because the scanner has not been started yet. This
behavior confuses users. Print a warning that the device needs to be
provisioned first before it can listen to unprovisioned beacons.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
In the simulated bsim boards there is no jittery delay
from a (D)PPI event until a TIMER starts.
The timer starts instantaneously so we do not need to
compensate for it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The building error is reported in Ubuntu if
CONFIG_NET_BUF_LOG is true.
Change __line__ to __LINE__ to fix building
error.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Use the HAL always when setting the TIMERs CC registers,
(also for coded Phy) to ensure things work properly for simulation.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add HCI input parameter validation according to spec for passing
qualification tests.
- Conditional compile of LE Set PA Receive Enable feature
- Store BIGinfo encryption state and number of streams
- Do not report BIGinfo if phy is invalid or unsupported
- Return disallowed ll_read_iso_tx_sync uses sync recever handle
- Validate BIS indices in ll_big_sync_create
Signed-off-by: Morten Priess <mtpr@oticon.com>
Fix CIS accepted by Host being failed in the Controller with
reason 0x20 Unsupported LL Parameter Value, by relaxing the
check that the ACL connection is sufficiently placed such
that the time reservation using in the Controller
implementation does not overlap with the CIG event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>