Commit Graph

4369 Commits

Author SHA1 Message Date
Krzysztof Kopyściński 89e7090c59 controller/ble_ll_sync.c: acad_len potentially uninitialised
acad_len in ble_ll_sync_rx_pkt_in is filled in ble_ll_sync_parse_ext_hdr
and later accessed in ble_ll_sync_check_acad. There is a possibility
that extended advertising header is missing data containing acad, and it
will not get filled, leaving it uninitialised.
2024-03-27 09:31:28 +01:00
Szymon Janc 53bae66f71 nimble/host: Fix reports when using legacy scan with EXT_ADV enabled
ble_gap_disc() should always results in BLE_GAP_EVENT_DISC and legacy
PDUs only.
2024-03-26 15:48:15 +01:00
Krzysztof Kopyściński 0bffd7a2a2 audio/ble_audio.h: remove unused argument description in ble_audio_event_listener_register
This looks like leftover and is not used.
2024-03-25 09:27:14 +01:00
Krzysztof Kopyściński bba23c8ec6 audio/ble_audio.h: fix doxygen reference for ble_audio_base_bis_iter
@ref was missing, and to make all file visible to doxygen
defgroup bt_le_audio was added.
2024-03-25 09:27:14 +01:00
Krzysztof Kopyściński 8abef55326 audio/ble_audio.h: add missing doxygen for ble_audio_broadcast_name
`ble_audio_broadcast_name` was not documented.
2024-03-25 09:27:14 +01:00
Krzysztof Kopyściński d1ad7b29c9 audio/ble_audio.h: fix duplicated defgroups
Couple defgroups had same title.
2024-03-25 09:27:14 +01:00
Andrzej Kaczmarek 5504556792 nimble/ll: Fix sync packet offset in syncinfo
We need to move periodic advertising event start time by full interval
(not only ticks) as otherwise any calculation of start time in the
future event will not be accurate.
2024-03-21 10:46:32 +01:00
Andrzej Kaczmarek 6d5fe383ef nimble/ll: Remove periodic adv min/max interval in sm
We only need current interval, no need to store min and max (and min was
never used anyway).
2024-03-21 10:46:32 +01:00
Andrzej Kaczmarek 074710e667 nimble/ll: Reschedule preempted adv event if possible
Currently we simply drop adv event if it was preempted, but instead we
can try to reschedule it as longs as new start time does not exceed
adv_delay limit.

Note that we only reschedule if no PDU was sent in that event, otherwise
we could not guarantee that aux is properly scheduled relative to exts.
2024-03-21 10:46:32 +01:00
Szymon Janc 6f8f2572e3 nimble/host: Connect EATT when encryption is enabled
Some peers reject connection to EATT PSM if encryption is not enabled.
Since EATT requires any PDUs to be sent only on encrypted link we
can postpone initiating EATT connection until encryption with no real
drawbacks.
2024-03-21 08:52:42 +01:00
Szymon Janc a6e47b687b nimble/host: Fix leak on EATT connection
If EATT COC connection failed we need to clean up allocated memory.
2024-03-21 08:52:42 +01:00
Szymon Janc a41b4570d6 nimble/host: Fix possible memory leak in ble_eatt_prepare_rx_sdu
ble_l2cap_recv_ready consumes om buffer only on success.
2024-03-21 08:52:42 +01:00
Szymon Janc 3d6bfda185 nimble/host: Fix EATT restrictions in syscfg
EATT requires Enhanced COC and number of available channels should be
at least that of supported EATT channels.
2024-03-21 08:52:42 +01:00
Szymon Janc b74b97fd7d nimble/eatt: Fix no resource handling on accept
Return error code instead of asserting on low resources.
2024-03-21 08:52:42 +01:00
Szymon Janc 826682d3ce nimble/hs: Make ble_eatt_start static and void
It is not used outside of ble_eatt.c
2024-03-21 08:52:42 +01:00
Szymon Janc 10c2ae8018 nimble/eatt: Fix NULL deref in ble_eatt_alloc
If ble_eatt_conn_pool was empty we would end up in writing NULL
address.
2024-03-21 08:52:42 +01:00
Szymon Janc e33099a190 nimble/host: Fix possible deadlock in ble_att_tx
If ble_hs_misc_conn_chan_find_reqd() failed function would exit with
HS lock locked.
2024-03-13 08:58:40 +01:00
Wojciech Pietraszewski a830ac3645 host/sm: Add doxygen comments to the header file
Adds missing macros, functions and structures documentation.
2024-03-12 09:39:31 +01:00
Piotr Narajowski 253f5901b6 nimble/host: Fix invalid response for mtu exchange request
This commit applies valid response (Request Not Supported) when mtu exchange
is requested over EATT.
2024-03-07 21:04:53 +01:00
Mariusz Skamra 75b35adb69 nimble/iso: Fix potential memory leak
This fixes potential BIG memory leak in case ble_hs_hci_cmd_tx returned
an error.
If the error is returned, the code will free the allocated BIG and
BISes.
2024-03-06 13:41:51 +01:00
Mariusz Skamra f901dfa0c2 nimble/iso: Fix missing big_handle return parameter
This fixes ble_iso_create_big to return the BIG handle created
to the API user.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2024-03-06 13:41:51 +01:00
taks 8b7eda2a56 nimble/host: Fix ble_gap_adv_set_data return code 2024-03-05 09:38:14 +01:00
Krzysztof Kopyściński e55baf9843 nimble/services: add PACS
This commit adds Published Audio Capabilities Service/Prifile. In pair
ble_audio_codec module is added, that supports registering supported
codecs with their corresponding configurations.
2024-03-04 08:41:25 +01:00
Krzysztof Kopyściński 49912bbd5b host/ble_hs: call ble_iso_rx_data if BLE_ISO_BROADCAST_SINK
BLE_ISO defines ISO as whole, but we RX iso data only when device is
broadcast sink.
2024-03-04 08:11:00 +01:00
Krzysztof Kopyściński a04a6d2ce6 host: refactor BLE Audio
This patch refactors BLE Audio library to conform to new directory tree
introduced in a9795706bea035d84d1577680e0814ceedc9dc58.

LE Audio related files present in host/include, host/src and
host/services were moved to corelated folders in host/audio.

Experimental system config BLE_AUDIO enabling LE Audio feature was introduced.

Naming convention for BLE Audio functions, structures and files was
unified - replaced `bcst` shorthand with `broadcast`. For example,
ble_audio_pub_bcst_announcement_feat was renamed to
ble_audio_pub_broadcast_announcement_feat.

Contents of host/include/ble_audio_common.h was incorporated into
host/audio/include/audio/ble_audio.h.

Apps and Auracast service were adjusted to new config and include paths.

BLE_MAX_BIG and BLE_MAX_BIS renamed to BLE_ISO_MAX_BIGS and
BLE_ISO_MAX_BISES, respectevaly.
2024-03-01 11:32:30 +01:00
Wojciech Pietraszewski ebe1e7804d host/iso: Add doxygen comments in the header file
Adds missing structures and functions documentation.
2024-02-28 16:04:52 +01:00
Mariusz Skamra a3cef58817 nimble/audio: Add LE Audio event listener
This adds dedicated event listener for LE Audio events.
2024-02-28 15:28:02 +01:00
Mariusz Skamra b3cd0b6280 nimble/audio: Add BASE parser
This adds BASE parser implementation along with unit tests.
2024-02-28 15:28:02 +01:00
Mariusz Skamra 2e368caab2 nimble/audio: Add LE Audio btshell target
This adds btshell for native target build with the LE Audio
functionality enabled.
2024-02-28 08:36:04 +01:00
Mariusz Skamra eacdbc36e0 nimble/iso: Fix missing BLE_ISO_BROADCAST_SOURCE guard
This makes Broadcast ISO source related code dependent on
BLE_ISO_BROADCAST_SOURCE mynewt option.
2024-02-28 08:36:04 +01:00
Mariusz Skamra 8c06f25637 nimble/iso: Add ISO Rx datapath and extend ISO Broadcast API
This adds ISO Rx datapath and along with Broadcast Sink ISO API
and implementation.
2024-02-28 08:36:04 +01:00
Mariusz Skamra 47d1bb50df nimble/iso: Fix BLE_ISO dependency
This adds the BLE_ISO dependency on BLE_ISO_BROADCAST_SOURCE and
BLE_ISO_BROADCAST_SINK.
Once one of those roles is enabled, the BLE_ISO shall be enabled.
2024-02-28 08:36:04 +01:00
Mariusz Skamra 90d270dfa1 nimble/controller: Conditionally enable BLE_LL_ISO_BROADCASTER
Enable BLE_LL_ISO_BROADCASTER if BLE_ISO_BROADCAST_SOURCE and/or
BLE_ISO_BROADCAST_SINK is enabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2024-02-28 08:36:04 +01:00
Wojciech Pietraszewski 26df457d7f host/audio_common: Add doxygen comments in the header file
Adds missing structures and macros documentation.
Adds minor corrections to existing entries.
2024-02-27 12:48:41 +01:00
Mariusz Skamra 41af6edec8 nimble/iso: Fix missing events in LE event mask
This fixes missing events:
* LE Create BIG Complete event
* LE Terminate BIG Complete event
in LE event mask.
2024-02-27 09:43:43 +01:00
Mariusz Skamra faaa8e821a nimble/iso: Fix missing BIG NULL pointer checks
The BIG lookup function returns NULL if BIG has not been found, thus to
be safe the return value has to be checked in case functions are called
with big_handle value of non-existent BIG.
2024-02-27 09:43:43 +01:00
Mariusz Skamra 894a8f497a nimble/iso: Fix BIG handle assignment
This fixes BIG handle value assigned on BIG instance allocation.
Dedicated function has been added to get unique handle from
BIG handles pool. PA dependency has been removed from ISO.
The checks have meen moved to ble_audio_broadcast_source.c.
2024-02-27 09:43:43 +01:00
Mariusz Skamra 23eec0a5ad nimble/controller: Enable LL encryption if BLE_LL_ISO_BROADCASTER
To support encrypting/decrypting broadcasts, LL Encryption shall be
enabled by BLE_LL_ISO_BROADCASTER.
2024-02-26 15:19:49 +01:00
Krzysztof Kopyściński 365468bfec nimble/host: prepare for Broadcast sink
This patch renames files, functions and configs from `broadcaster` to
`broadcast source` so new `broadcast sink` files and functions can be
created. Adds `BLE_ISO_BROADCAST_SINK` sysconfig
2024-02-26 15:16:07 +01:00
Mariusz Skamra c102b8b246 nimble/drivers/native: Add missing function stubs
This fixes unit test compilation error caused by missing
ble_phy_tifs_txtx_set() and ble_phy_encrypt_header_mask_set() function
stubs used by ble_ll_iso_big.c and ble_ll_isoal.c.
2024-02-23 14:50:28 +01:00
Krzysztof Kopyściński adfa1b8127 host/ble_audio_broadcast: add clarification for big_params pointer
Added clarification for `big_params` pointer in
`ble_broadcast_create_params`.
2024-02-23 09:19:23 +01:00
Szymon Czapracki 620064e69d nimble/gap: Fix for resolving list peer removal
This commit aims to fix an issue where deleting
peer from resolving list would fail due to
lack of IRK on the list.
2024-02-21 11:18:02 +01:00
Wojciech Pietraszewski 1342693244 host/gatt: Amend doxygen comments in the header file
Adds missing functions documentation.
Adds minor formatting improvements.
2024-02-20 08:39:42 +01:00
Mariusz Skamra 818e06400a nimble/phy: Fix compilation error
This fixes compilation error caused by value assignment to undefined
structure aux_data member. Introduced in 4e58b2724.
2024-02-20 08:38:39 +01:00
Wojciech Pietraszewski 20c55b223b host/audio_broadcast: Amend doxygen comments in the header file
Adds missing structures and functions documentation.
Corrects usage of 'param' tags.
2024-02-16 17:08:59 +01:00
Krzysztof Kopyściński b27535edbc host/ble_iso.h: remove unused functions
ble_gap_rx_create_big_complete and ble_gap_rx_terminate_big_complete are a
leftover from initial implementation and shall be removed. Correct,
implemented funcions are ble_iso_rx_create_big_complete and
ble_iso_rx_terminate_big_completem, in private API
2024-02-15 11:44:59 +01:00
Szymon Janc d42a0ebe66 nimble/host: Fix disconnect on host connection timeout
We don't need to have double loop and lock-unlock host lock when
issuing disconnect. ble_gap_terminate_with_conn() can be used
to disconnect and it can be called with already provided conn object
under host lock.
2024-02-14 21:27:16 +01:00
Wojciech Pietraszewski ae9273d3af host/hs_log: Amend doxygen comments in the header file
Adds missing macro documentation (BLE_NPL_LOG_MODULE).
Adds minor formatting improvements.
2024-02-14 15:17:37 +01:00
Wojciech Pietraszewski 33d069e5c5 host/uuid: Amend doxygen comments in the header file
Corrects variadic macro documentation (BLE_UUID128_INIT).
Adds minor formatting improvements.
2024-02-14 14:52:31 +01:00
Rahul Tank 768a6c7165 nimble/host: Fix compilation issues observed by enabling -O2 optimization 2024-02-13 15:48:03 +01:00