Commit graph

9523 commits

Author SHA1 Message Date
Emil Gydesen
3a6952e3e6 Bluetooth: iso: Compile conn.c for BT_ISO even without BT_CONN
If BT_ISO is enabled we now compile conn.c which contains a
lot of functionality used by BT_ISO, even for broadcast-iso
builds, i.e. builds that do not require BT_CONN.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
a02abea0a2 Bluetooth: conn: Move ACL only data fields to ACL group
Move the data that is only relevant for ACL to
a guarded ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
72319abc7e Bluetooth: conn: Add BT_CONN guards in bt_conn_set_state
Add BT_CONN guards for ACL only functionality in
bt_conn_set_state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
32da3287ac Bluetooth: conn: Add BT_CONN guard to bt_conn_get_pkts
Add a guard for BT_CONN and return NULL if no
packets can be returned.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
90a9ea92e2 Bluetooth: hci_core: Remove BT_CONN guard for ISO fields in bt_dev_le
Change the guard such that the iso_mtu and iso_pkts are
not guarded by BT_CONN as they should be available for
iso broadcast-only builds.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
4ac8a9e6c0 Bluetooth: conn: Add guard for ACL in conn_mtu
Add guard for accessing the bt_dev.le.acl_mtu if
CONFIG_BT_CONN is not enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
5612f60185 Bluetooth: conn: Add bt_acl_recv for ACL only data
Add the bt_acl_recv function that works similar to
bt_iso_recv but for ACL data only, simplying the
generic bt_conn_recv function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c877045133 Bluetooth: conn: Guard acl_send with CONFIG_BT_CONN
Guard the ACL send to only be called if CONFIG_BT_CONN
is enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c56fd68a13 Bluetooth: conn: Move bt_conn_connected to ACL group
Move the bt_conn_connected function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
6952dcd7a8 Bluetooth: conn: Move acl_conns to ACL group
Move the acl_conns array to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
2249091176 Bluetooth: conn: Move bt_conn_disconnect to ACL group
Move the bt_conn_disconnect and conn_disconnect functions
to the ACL group.

Also adds a guard in the iso.c file for connected ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
d203422082 Bluetooth: conn: Fix type of recieved to received
Fixed a typo that caused a CI issue.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
cbec9ffbc0 Bluetooth: conn: Move ACL callback handlers to ACL group
Move the notify_le_phy_updated, notify_le_data_len_updated,
notify_le_param_updated, notify_remote_info,
notify_disconnected and notify_connected functions
to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
866062d7ca Bluetooth: conn: Move ACL conn param functions to ACL group
Move the send_conn_le_param_update and le_param_req functions
to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
bee720e797 Bluetooth: conn: Move tx_complete_work to the ACL group
Move the tx_complete_work function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
fc69f01136 Bluetooth: conn: Moved deferred_work to the ACL group
Move the deferred_work callback function to the ACL group.
This also moves the static function conn_lookup_iso
which is only called form deferred_work.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
fce489087f Bluetooth: conn: Move acl_conn_new to the ACL group
Move the acl_conn_new function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c6472f3b56 Bluetooth: conn: Move the BREDR functions to the ACL group
Move the BREDR functions to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
1aefa8baac Bluetooth: conn: Move SMP functions to the ACL group
Move the SMP functions to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
d0d2df4cd8 Bluetooth: conn: Move bt_conn_cb_register to ACL group
Move the bt_conn_cb_register function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
83e25a7d4b Bluetooth: conn: Move the bt_conn add and exist functions to ACL group
Move the bt_conn_add_le and bt_conn_exists_le functions to the
ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
f1e438c63b Bluetooth: conn: Move bt_conn ACL lookup functions to ACL group
Move the bt_conn_lookup_state_le, bt_conn_lookup_addr_le and
bt_conn_is_peer_addr_le functions to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
9ec9943bab Bluetooth: conn: Move bt_conn_get_dst to ACL group
Move the bt_conn_get_dst function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
8b64e3c8fd Bluetooth: conn: Move bt_conn get info functions to ACL group
Move the bt_conn_get_info and bt_conn_get_remote_info functions
to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
bcf2515f3b Bluetooth: conn: Move TX power level functions to ACL group
Move the bt_conn_get_tx_power_level and
bt_conn_le_get_tx_power_level functions to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
422beb41bd Bluetooth: conn: Move bt_conn_le_param_update to ACL group
Move the bt_conn_le_param_update function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
c9250fea7c Bluetooth: conn: Move bt_conn_le_data_len_update to ACL group
Move the bt_conn_le_data_len_update function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
661377192a Bluetooth: conn: Move bt_conn_le_phy_update to ACL group
Move the bt_conn_le_phy_update function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
05c67528e9 Bluetooth: conn: Move the ACL create functions to ACL group
Move the central role functions to create BT connections to
the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
a7b1ab4d3e Bluetooth: conn: Move bt_conn_le_conn_update to ACL group
Move the bt_conn_le_conn_update function to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
11d7fd3afd Bluetooth: conn: Move bt_conn_create netbuf functions to ACL group
Moves the bt_conn_create_frag_timeout and
bt_conn_create_pdu_timeout to the ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
12ce4b8ba9 Bluetooth: conn: Move bt_conn_auth_* functions to ACL group
Move the bt_conn_auth_* functions to the newly create
ACL group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Emil Gydesen
2cb6f3cf3e Bluetooth: conn: Start connected-only grouping
Start a group of functions guarded by CONFIG_BT_CONN
that are for connected-only functions. This is a
preparation step for allowing compilation and usage of
conn.c for ISO broadcast-only builds.

Moving all connected-only functionality into a single
group will also allow a possible move of all those
functions into an connected (ACL) only file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Agata Ponitka
a279ff3958 Bluetooth: Mesh: Fix Health Client Model
Assigning a value to the msg_timeout parameter.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
22aafd422c Bluetooth: Mesh: Add missing Configuration Client API
Add missing API:
- Delete all group addresses in a SIG model's subscription list
- Update a network key
- Update an application key
- Get/Set Node Identity parameters
- Set virtual addtess for a SIG model
- Get/Set Key Refresh Procedures

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Agata Ponitka
e962cbb9fd Bluetooth: Mesh: Fix Configuration Client API
Hardcoded invalid Company ID was used instead of the parameter passed to
the API.

Signed-off-by: Agata Ponitka <agata.ponitka@codecoup.pl>
2021-07-22 22:41:32 +03:00
Vinayak Kariappa Chettimada
2c606239e2 Bluetooth: Controller: Make adva and tgta check function file static
The functions to check advertising and target address in a
PDU are used only inside the same file, hence make them file
static functions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Vinayak Kariappa Chettimada
33c06e6992 Bluetooth: Controller: Move assignments close to locality of reference
Minor refactor to move assignment statements close to their
locality of reference.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Vinayak Kariappa Chettimada
dee5b53b73 Bluetooth: Controller: Add target address check to extended scanning
Add target address check to extended scanning implementation
to detect invalid target address present in primary and
auxiliary channel PDU. Implementation is reuse of the check
used in the initiator after refactoring to pass parameter to
differentiate, its use for primary or auxiliary channel, and
for scanning or initiating.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-22 17:35:22 +02:00
Bud Wandinger
7a2b248b98 Bluetooth: Mesh: Added support for application access to mesh messages
Added bt_mesh_msg_send() which can be used by the application to
directly send model layer messages without local instantiation of
related models. Also added bt_mesh_msg_cb_set() which allows the
application to recieve mesh model layer messages without local
instantiation of related models.

Added bt_mesh_has_addr() which returns a bool. For unicast addresses,
this returns whether or not bt_mesh_elem_find() was successfull. If the
above mentioned bt_mesh_msg_cb_set() has been used by the application to
set a message callback, this returns true so that the stack attempts to
push every model message up to the application via the callback. If no
callback has been set, group addresses are searched to see if the stack
should pass the message up the stack to an instantiated model.

These changes allow applications that do not or can not instantiate
models to interface with models in a mesh network. This is applicable to
applications which act as a Bluetooth mesh gateway, sniffer, debugger,
network monitoring, non-mesh relay/extender, etc.

In app_keys.c friend.c net.c bt_mesh_elem_find() is used only to
determine the existance of an address. The full return value of
bt_mesh_elem_find() is unecessary and so was replaced by the above
mentioned bt_mesh_has_addr() function in these instances.

Simplified bt_mesh_elem_find() by removing the search through group
address. Since the above mentioned bt_mesh_has_addr() function handles
instances where group addresses must be searched, it was no longer
necessary to preform this search in this function.

Signed-off-by: Bud Wandinger <bud@budkoembedded.ca>
2021-07-22 06:23:56 -04:00
William Fish
6b67a568c9 Bluetooth: Mesh: Provisioning Start Fix
Resolves provisioning start process

Signed-off-by: William Fish <william.fish@manulytica.com>
2021-07-22 11:20:23 +03:00
Vinayak Kariappa Chettimada
636fbcd081 Bluetooth: Increase maximum allowed identity range to 64
Increase the maximum allowed identity range to 64.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Johan Hedberg
9aedfa676b Bluetooth: L2CAP: Fix CIDs in disconnect request
The destination and source CIDs were mixed up in the L2CAP
Disconnect request.

Fixes #36665

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-07-21 10:23:10 +03:00
Lingao Meng
40365babaa Bluetooth: Modify kconfig to use related path
Because we use the extended kconfig, we have already
supported relative paths, and it is clearer to use
relative paths in the bluetooth submodules.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-07-20 20:02:34 -04:00
Vinayak Kariappa Chettimada
52db419e7a Bluetooth: Mesh: Update advertising duration calculation
Zephyr Bluetooth Low Energy Controller for mesh stack
uses pre-emptible continuous scanning, allowing advertising
events to be transmitted without delay when advertising is
enabled. No need to compensate with scan window duration.

Zephyr Bluetooth Low Energy Controller built for nRF51x
SoCs use CONFIG_BT_CTLR_LOW_LAT=y, and continuous scanning
cannot be pre-empted, hence, scanning will block advertising
events from being transmitted. Increase the advertising
duration by the amount of scan window duration to compensate
for the blocked advertising events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Vinayak Kariappa Chettimada
d84397f66d Bluetooth: Controller: Disable scan unreserved for LOW_LAT option
Disable use of BT_CTLR_SCAN_UNRESERVED with BT_CTLR_LOW_LAT.
nRF51x SoC needs to block any CPU use inside radio events,
hence use of radio without time reservation is required for
proper functioning of Controller in nRF51x.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-20 13:35:49 +02:00
Trond Einar Snekvik
abcbfed6c3 Bluetooth: Mesh: Provisioning PDU length defines
Adds length defines for all provisioning PDUs and uses them to split
prov_link.conf_inputs into separate fields.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-07-20 13:32:57 +02:00
Emil Gydesen
6ee70bd220 Bluetooth: Audio: Fix compile error if AICS is not enabled
Fix compile error if AICS is disable but AICS_CLIENT is
enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
e6d49645de Bluetooth: Audio: Guard MICS cli/srv structs
Add guards to the structs. This has two purposes:
1) Reduce size of only one of them are enabled
2) Fix a compile issue if only one of them were enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00
Emil Gydesen
dfc1fa39b6 Bluetooth: Audio: Guard VCS cli/srv structs
Add guards to the structs. This has two purposes:
1) Reduce size of only one of them are enabled
2) Fix a compile issue if only one of them were enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-19 20:08:30 -04:00