Commit Graph

14 Commits

Author SHA1 Message Date
Emil Gydesen ec2c5b0c1f Bluetooth: GATT: Replace magic number 0 with macro for auto ccc
Replace the magic number 0 with a #defined value for
the auto CCC discovery feature.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-09-26 17:41:24 -04:00
Henrik Brix Andersen 159f7dbbb1 lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h
Move the network buffer header file from zephyr/net/buf.h to
zephyr/net_buf.h as the implementation now lives outside of the networking
subsystem.

Add (deprecated) zephyr/net/buf.h header to maintain compatibility with old
file path.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-09-07 11:19:05 -05:00
Emil Gydesen ebadb11645 Bluetooth: Audio: Spring cleaning
Adds, removes and modifies includes in all LE audio
files.

Fixes any found spelling mistakes as well.

Fixes a few places where incorrect types were used.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-04 13:37:53 +02:00
Emil Gydesen ec41dd9ba6 Bluetooth: Audio: Use BT_GATT_SUBSCRIBE_FLAG_VOLATILE
The LE Audio implementations do not really support bonding yet,
and removing subs on disconnect is the most effective (and correct)
way of ensuring that we do not subscribe more than once when we
re-discover after reconnection.

The broadcast assistant and the media control client does not
support multiple connections as of this commit, so they needed
special treatment. In the case that we do discovery on multiple
ACL connections, it is important that the existing subscriptions
are removed correctly by calling bt_gatt_unsubscribe.

In order to implement this change properly on some of the clients,
thet had no proper connection references or support
for clearing the data on disconnects, they had to be updated
as well.

The csip_notify.sh test has been disabled, as that expected a
notification in the client, but since this commit removes that
(until bonding is properly supported in the clients), then the
test will fail.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-02 09:34:52 -06:00
Mariusz Skamra b79a3415a9 Bluetooth: audio: has_client: Move bt_has_client structure to header
This moves bt_has_client instance structure to has_internal.h header
file to be able to access to the instance members in tests.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2024-01-02 10:10:15 +01:00
Mariusz Skamra 1cb80d3282 Bluetooth: audio: has_client: Use CONTAINER_OF to get client instance
This starts using CONTAINER_OF macro instead of inst_by_conn function
wherever possible. It's better approach as the client instance is
a container for parameters passed to the callbacks.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-14 09:31:59 +01:00
Emil Gydesen 2a2f067333 Bluetooth: HAS: Add missing memset of read params
The missing memset caused invalid chan_opt when EATT was
enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-05 11:26:11 +02:00
Théo Battrel e458f5aae6 Bluetooth: Use Zephyr standard log system instead of `bluetooth/common/log`
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.

Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`

Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.

For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-25 17:08:36 +01:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Mariusz Skamra 541d946d10 Bluetooth: audio: Add HAS client support for preset switching
This adds client support for switching the active preset along with bsim
tests implementation.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-18 12:46:27 +02:00
Asbjørn Sæbø af607bb886 Bluetooth: Gatt: Update users of write callback in subscription params
Update the users of the "write" callback in the
bt_gatt_subscribe_params to use the new "subscribe" callback instead.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-05-16 16:54:27 +02:00
Mariusz Skamra 2d87443a4a Bluetooth: has: Add support for Read Presets Request operation
This extends client implementation with Read Presets Request operation
support.
The implementation can maintain up to BT_L2CAP_TX_BUF_COUNT control
point requests so that user could perform/queue another Control Point
Operation if one is ongoing. E.g. preset can be selected from Read Preset
Response notification context or perform multiple operations if EATT
enabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-13 08:46:21 -07:00
Gerard Marull-Paretas 5113c1418d subsystems: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:07:35 +02:00
Mariusz Skamra db59647c0a Bluetooth: has: Add initial Hearing Access Service client
This adds initial support for Hearing Access Service client. The client
performs GATT discovery to find and read HAS related characteristics and
subscribe for characteristic value notifications/indications.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-04-07 09:37:53 +02:00