This file fails to compile since commit ef7b132bfd ("Bluetooth:
Classic: Fix initialization to support re-initialization"), which added
a LOG_ERR() invocation but didn't setup logging for the file.
Fixes#101810
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Use the ZTESTABLE_STATIC macro to define symbols which need to be
accessible from ztests, instead of redefining STATIC which causes
trouble with some hals.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for CS IPT (Channel Sounding Inline PCT Transfer)
in the Bluetooth host stack.
Changes include:
* definition of new CS IPT HCI opcodes;
* handling of CS IPT control procedures;
* integration with existing CS infrastructure;
* necessary updates to public headers.
Signed-off-by: Aleksandr Mirlenko <aleksandr.mirlenko@nordicsemi.no>
Before this we have a memory leak in the prep_pool when reassembly fails
in :c:func:`att_exec_write_rsp`. Now on error the buffer is dequeued and
freed, as are remaining queued prepare buffers.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
Rename it to USB buffers so we can use it in host support without
confusion. Keep the UDC_* macros for now, we can deprecate and remove
them later.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The implementation only used the receive state's PA sync state
to determine whether to call the PA sync req or PA sync term req,
but that state does not include the syncing state.
Rather than using the receive state's PA sync state, we add a local
boolean to keep track of whether the PA sync was requested, so if
we receive a mod_src with PA sync == BT_BAP_BASS_PA_REQ_NO_SYNC then
we request a termination, even if the PA sync was not established yet.
Some cleanup in the mutex handling was also done as part of this.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Make sure choice option name is not same as actual config option
that is enabling it. Use _SECURITY suffix for clarity of what
choice is actually about.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
CTS is missing the Local Time Information characteristic and this
commit adds the UUID and the full characteristic to its service.
The peripheral example has been updated as well to use this and
implement it on the example so it is easy to test it out.
Signed-off-by: Martin Moya <moyamartin1@gmail.com>
- Add kconfig for HCI event synchronous buf pool to allow vendors
to configure buffer count based on the application/host platform
requirements
Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
Added support for elapsed time service (ETS). The service
is introduced currently with the experimental tag.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
The TBS spec only specificially disallows join for calls in
the incoming state. The Alerting and Dialing state in Zephyr
were disallowed, but that fails some TBS join tests.
Removed the (implicit) checks for alerting and dialing and
updated the state changer code to be more explicitly so that
all call states, except for incoming, is explicitly handled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor bt_tbs_set_uri_scheme_list to take a single string instead
of an array of URIs. This should not affect applications much
in any way (and may actually be easier to use), but simplifies
the implementation significantly, and reduces memory footprint.
Additionally it also make the client and server more similar
as bt_tbs_client_read_uri_list just returns it as a single
string as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
bt_pacs_register would assert if e.g.
CONFIG_BT_PAC_SRC_NOTIFIABLE=y but param.src_pac = false.
Add checks for setting the attributes, only if the parameter
actually enables the characteristics.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Avoid dereferencing `stream` in the debug log message when checking
for invalid input parameters.
The previous log printed `stream->ep` and `stream->conn` inside a
combined NULL check, which could trigger static analysis warnings
about a possible NULL pointer dereference.
Align the implementation with the existing pattern used in the file
by logging a generic "Invalid stream" message instead.
No functional change.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
When starting adv via handover, we log the address used
for the advertising set for debugging purposes.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement the validation if there is exactly one GAP service
in GATT database.
The validation is performed as soon as the GATT database
is available and forbids to enable the Bluetooth if the configuration
is not compatible with the Bluetooth Specification.
The verification may be disabled by the user for better performance
or deliberate implementation that is not compliant with the
specification.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Set the unused argument of the name characteristic to NULL.
This removes the reference from GAP service to the hci_core.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Rename the DEVICE_NAME_GATT_WRITABLE_ kconfig options to
BT_DEVICE_NAME_GATT_WRITABLE_.
Rename DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN to
BT_DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN.
The old options are marked as deprecated.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Remove Generic Access Service implementation from gatt files and move it
into separate file in services directory.
The default service implementation can be disabled by the user in purpose
of providing the GAP implementation directly in the application.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Add check in valid_unicast_audio_start_param to verify
that the ep connection matches the member_conn.
Instead of declaring the endpoints in the unit tests, we
not define them in the mock unicast client and use the
discover function to get pointers.
This allows for a proper implementation of
bt_bap_unicast_client_has_ep as well as makes the tests more similar
to a normal application.
This change required a significant change in the unicast_stop
unit tests as well, which uncovered a small bug in the implementation.
The bug was fixed as part of this commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There's no use of k_poll in the host stack anymore, so remove leftovers
and related definitions.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The Bluetooth Mesh code depends on k_poll, so it should have the
appropriate select statement in its Kconfig.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Update ll_data_path_tx_pdu_release() to have return -ENOTSUP
so that the node_tx is released using the fallback method to
use the MFIFO from LLL to ULL_HIGH context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The net_buf was always initialized with net_buf_simple_init_with_data
which was a bit wasteful as we only need to do that once. Since `inst`
is `static`ally allocated, we can check for `.data == NULL`.
Additionally the read callbacks expect the buffer to be 0-initialized
between each usage, which wasn't the case. We can use the `buf.len`
to determine how many bytes we need to reset to `0`.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The current way of setting the public address using
`bt_hci_driver_api::setup` does not work well in split builds
where host and controller runs on different cores/socs/boards.
This approach requires each HCI driver and each `hci_<transport>`
application to implement the setup and pass the information on
to the next layer.
Zephyr already defines a vendor-specific command that can be used
to set the public address (`bt_hci_cp_vs_write_bd_addr`).
Use this in `bt_enable` after opening the HCI transport and before
initializing the id module. This makes the setup independent of
hci transport and only depends on a controller that implements the
Zephyr HCI VS commands.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
The static global UUID variable in the GATT shell module was shared across
all concurrent discover and read-by-uuid operations, creating a potential
race condition where one operation could overwrite the UUID before another
completed. Move UUID storage into the per-operation gatt_op_context
structure to isolate UUID state for each operation. This enables safe
concurrent operations without data corruption.
Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
The friendly name buffer sizes used the URI length, but since
the friendly name is specifically not an URI that did not make
sense. Added a new Kconfig option to configure the maximum
supported friendly name, which is shared between both TBS
and the TBS client, similar to the other max Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>