Broadcast ID is 24bits and uinitialized broadcast_id resulted in
(pseudo) random failures since only 3 bytes were set by call to
bt_rand().
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This helps to circumvent issues in current BAP implementation when
multiple streams are present. Also puts RX path in line with
configuration of TX path.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add two optional arguments to shell commands `sdp_client sa_discovery`
and `sdp_client ssa_discovery`.
The first argument is the beginning of the attribute ID.
The second argument is the ending of the attribute ID. If the second
argument is omitted, the ending of the attribute ID is 0xffff.
Add test case `test_sdp_ssa_discover_multiple_records_with_range` to
test the ssa request with attribute ID list.
Add test case `test_sdp_sa_discover_multiple_records_with_range` to
test the sa request with attribute ID list.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Modify the code to use the public API to get the endpoint
ID and direction rather than relying on the internal
bap_endpoint.h header file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The bt_ascs_ase_status was stored directly in the
struct bt_bap_ep, which was an issue as
bt_ascs_ase_status is a variable sized struct.
The struct could have been moved to the end of
bt_bap_ep to avoid the issues it caused, but
there is no actual reason to use that struct
rather than storing the ID and state as
seperate values.
The ascs_ep_get_state exists but was not widely
used in ascs. Modify places to use the function
instead of directly accessing the state.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This is used for properly tracking if legacy or extended advertising
API is used and should not be changed if advertisign is enabled.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
If extended advertising was used GAP module was always creating
new instance on advertising start (while failing to stop it at
the same time).
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add support for setting and getting the bearer provider
name. For now the name will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the name exists.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify values in audio.conf to reduce memory usage.
Most notably disabling logs reduced the FLASH requirements.
Ideally the shell works as expected without debug logs, but
there are far too many profiles and services to verify them all.
All the log options are left in audio.conf so they can easily be
re-enabled when needed.
Memory before this change:
Memory region Used Size Region Size %age Used
FLASH: 1018512 B 1 MB 97.13%
RAM: 423146 B 448 KB 92.24%
IDT_LIST: 0 GB 32 KB 0.00%
Memory after this change:
Memory region Used Size Region Size %age Used
FLASH: 791308 B 1 MB 75.47%
RAM: 369090 B 448 KB 80.46%
IDT_LIST: 0 GB 32 KB 0.00%
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The error code instead of `BTP_STATUS_FAILED` of the function
`bt_le_ext_adv_create()` should be returned.
Returns the error code returned by `bt_le_ext_adv_create()`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add `LOG_ERR()` to log all reasons if status is `BTP_STATUS_FAILED`.
Add `LOG_DBG()` to log the excution result of the BTP commander.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add command `BTP_GAP_BIG_CREATE_SYNC` to create BIG sync establishment.
Add event `BTP_GAP_EV_BIG_SYNC_ESTABLISHED` to notify the event that
the BIG sync is established.
Add event `BTP_GAP_EV_BIG_SYNC_LOST` to notify the event that the BIG
sync is lost.
Add event `BTP_GAP_EV_BIS_DATA_PATH_SETUP` to notify the event that
the data path of the BIS is setup.
Add event `BTP_GAP_EV_BIS_STREAM_RECEIVED` to notify the received BIS
stream data.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Introduce prepare being deferred due to previous events
desire to continue. In such case the deferred prepare param
will have the defer flag set.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a test case test_sdp_discover_with_range to test the ssa request
with attribute ID range with the following test steps.
Step 1, Discover all included attribute IDs,
Step 2, Set the start of range from 0 to (max value + 9) of the
discovered attribute ID,
Step 3, Set the end of range from start of range to (max value + 9)
of the discovered attribute ID.
step 4, Send SSA request with the specific attribute ID range,
Step 5, check the discovery result according to the range,
Step 6, repeat step 4 - 5 until the range to
(max value + 9, max value + 9).
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The Controller is abbreviated as CTLR in contrast to CTRL
which is used in the context of Link Layer Control
Procedures.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
IUT works as a l2cap client with basic mode. The peer device,
l2cap server with basic mode, is a PC with running bumble on it.
This test only performs the function of L2CAP basic mode.
Support multiple l2cap enerties in new shell l2cap_br,
which may support more test function.
In the test suite , there are two groups in test cases.
Group 1 Including case1-case24 focuses on connection and
disconnection around l2cap. The impact of active and passive
acl connectivity, disconnectivity and authentication as well as
disconnection from ACL without l2cap disconnect is tested.
Group2 Including case25-case31 revolves around the basic
parameters of L2CAPserver configuration, data transfer.
Case 25: Test l2cap connection with max MTU(0xffff).But the max mtu
which the stack supports is (CONFIG_BT_BUF_ACL_RX_SIZE - 4U = 196).
Case 26: Test l2cap multi_channel connection and data tranfer.
Case 27: Test l2cap connection with invaild PSM.
Case 28: Test l2cap re_connect after disconnected.
Case 29: Test l2cap connection with min MTU(0x30).set server mtu = 48,
client mtu=48. l2cap connect successfully,
both server and client mtu should be 48.
Case 30: Test l2cap connection with min MTU(0x30). set server mtu = 48,
client mtu=0x27. l2cap connect fail.
Case 31: Test l2cap connection with min MTU(0x30).set server mtu = 30,
client mtu=48.l2cap connect successfully,
both server and client mtu should be 48.
test_l2cap_client.py is a file containing real test cases.
test_l2cap_common.py is a common file. It encapsulates some
test function functions that are commonly used for test cases.
Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
In current implementation, the attribute of the registered SDP record
will not be included in responding packet if the attribute data length
is more than the MAX payload size(`MIN(SDP_MTU, sad->sdp->chan.tx.mtu)
- sizeof(struct bt_sdp_hdr)`). And it causes the failure of ssa or sa
discovery.
Improve the SDP server to support the case by extending the
continuation state length. A 4 bytes space is extended to store the
attribute offset.
In this way, the attribute can be transmitted in segments according
to the reaming space of the responding buffer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add test that ensures that bt_cap_unicast_group_foreach_stream terminates
correctly if the callback returns true.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add verification of the CAP Unicast Audio Start callback parameters.
There was a missing part in the BAP Unicast Client mock that did not
set the ISO state correctly, which caused the procedures to fail, but
without the verification that was not caught.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement Start Discovery command Accept Filter List filtering.
Add a flag to the command's flags field to enable filtering.
Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The new option is HAS_BT_CTLR, however since it's a promptless option,
disable the native link layer instead, which most likely was the intended
effect.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Implement the unicast to broadcast handover procedure,
as per the Bluetooth CAP specificiation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add commands for GOEP to test OBEX features.
Add command `alloc-buf` and `release-buf` to allocate and release TX
buffer.
Add command set `add-header` to add the OBEX headers to allocated TX
buffer.
Add command set `client` to send OBEX client requests with allocated
TX buffer.
Add command set `server` to send OBEX responses with allocated TX
buffer.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add commands for GOEP to test transport features.
Add commands for transport over RFCOMM, including `register-rfcomm`,
`connect-rfcomm`, and `disconnect-rfcomm`.
Add commands for transport over L2CAP, including `register-l2cap`,
`connect-l2cap`, and `disconnect-l2cap`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The default integration platform for all test cases is native_sim, but
there has never been a USB device controller available for native_sim
platform. Since legacy device support has been deprecated and all tests
and samples now use the usbd test feature tag, this test cannot be
performed on native_sim.
Remove bluetooth.shell.cdc_acm to resolve CI failures.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit adds support for the frame space update feature
to the bluetooth host.
This is mainly just a wrapper around the frame space update
HCI command and event.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
The struct bt_audio_codec_cfg recently got new fields that
previously defaulted to
BT_AUDIO_CODEC_CFG_TARGET_LATENCY_BALANCED and
BT_AUDIO_CODEC_CFG_TARGET_PHY_2M but was not set by the BTP
commands.
For now we restore the previous functionality by setting the
values to the same as we did before, until the BTP commands
are changed (if they are changed).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit allows to the user to control the use or not of dynamic
connection callbacks.
The stack is not using the dynamic connection callbacks so they are
only needed if the applications want to use it.
Setting it to true for backwards compatibility.
With dynamic connection callbacks
FLASH: 176600 B 512 KB 33.68%
RAM: 27428 B 64 KB 41.85%
IDT_LIST: 0 GB 32 KB 0.00%
Without dynamic connection callbacks
FLASH: 176376 B 512 KB 33.64%
RAM: 27428 B 64 KB 41.85%
IDT_LIST: 0 GB 32 KB 0.00%
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
BIS termination as broadcaster is handled different
than ACL and CIS, and in rare chances the
tx_complete for BIS may not have been completed in
the system workqueue before iso_new was called for the
same bt_conn struct (e.g. via bt_iso_cig_create), which
would perform
k_work_init(&conn->tx_complete_work, tx_complete_work);
but where conn->tx_complete_work still existed in
the system workqueue, which would cause the list
of pending items on the system workqueue to be removed
as the `next` pointer would be NULL.
This also adds an assert in bt_conn_new to prevent this
issue from appearing again.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In current implementation, the UUID 128 is not well supported. The
found issue includes,
Issue 1: No clear byte order of the UUID 128 in local SDP record.
Issue 2: No clear byte order of the UUID 128 of the SDP discover
parameter.
For issue 1,
Add the description to note that if the SDP attribute type is
`BT_SDP_UINT128`, `BT_SDP_INT128`, and `BT_SDP_UUID128`, the byte
order should be little-endian.
And swap the 128bit from little-endian to big-endian when responding
the peer SDP discovery request.
For issue 2,
Add the description to note that if the SDP discovery type is
`Service Search` and `Service Search Attribute`, and UUID is UUID 128,
the passed UUID data of the discovery request parameter should be
represented as the little-endian byte-order sequence.
And swap the 128bit from little-endian to big-endian when packing the
SDP discovery packet.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit adds support for the extended feature set
feature. This includes:
- hci boilerplate
- kconfigs, including one for a max local feature page
- reading remote features is done by a command and callback
- this is not linked into the auto feature request on
connection as this procedure can take quite a few connection
events, and we do not want to delay the user
- added the commands to the bt shell
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>