According to AVCTP v1.4: On the controller and the target side,
handling of transaction labels is dependent on the application.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Remove the transaction label mechanism because:
1. Not necessary at stack, typically an application can handle the
timeout mechanism if required (very rarely).
2. It is a burden on memory size to record all pending commands.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch allows the upper layer to acquire the remote AVRCP
capabilities. These capabilities can be further used in register
notifications.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
sizeof('\0') is misleading as it will return 4 instead of 1,
since it will evaluate to sizeof(0), which returns the size
of the `int` type. Modify the expression to use sizeof(char)
with a comment.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes typos in the BT_DEVICE_NAME_GATT_WRITABLE_SECURITY and
BT_DEVICE_APPEARANCE_GATT_WRITABLE descriptions.
Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
When the board has been provisioned and the board is rebooted
it was not possible to connect to the board through the proxy
servcie. This fixes that the Mesh Proxy servive is restarted
after the board is rebooted.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
Previously, PB-GATT unprovisioned advs would continue being sent if a
device is provisioned or in the process of being provisioned (an active
provisioning link) over PB-ADV.
This commit introduces the `link_cancel` callback for the `prov_bearer`
struct. When a provisioning link is established over a prov bearer, all
other (active) prov bearers will be suspended through this callback, and
re-enabled when the link is closed. An exception is made for PB-REMOTE,
which can utilize the other bearers.
The call to `bt_mesh_pb_gatt_srv_disable` in settings.c is removed. This
is called in `mesh_commit`, and is not needed as this is only used
during boot, at which point the Mesh provisioning service has not yet
been enabled/registered, meaning the function does nothing.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Fix ull_hdr_get_cb() for advanced scheduling to return
ticks_slot for Peripheral role.
Relates to commit d6c3e04eb8 ("Bluetooth: Controller:
Central maximum data PDU size time spacing").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
added function to calculate antenna path
based on the antenna permutation index and
total number of antenna paths
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
Move functions `bt_sco_cleanup()`, `bt_conn_create_br()`,
`bt_hci_connect_br_cancel()`, and `bt_conn_get_dst_br()` from `conn.c`
to `conn_br.c`.
Change the function `bt_hci_connect_br_cancel()` to internal public
function.
Add a header file `conn_br_internal.h`. And declare the function
`bt_hci_connect_br_cancel()` in the header file.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Clarifies the use of identity in `bluetooth.h` by specifying whether the
documentation refers to the identity address, i. e. the actual address
`bt_addr_le_t`, or the identity handle, i. e. an index corresponding to
a specific identity address.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Several members of the ull_hdr can be removed, saving 12 bytes
from all ULL instances used (and a bit of code as well)
ticks_active_to_start is always 0 and can be removed completely
ticks_prepare_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_XTAL_US), so replace usage
of it by this constant
ticks_preempt_to_start is always set to
HAL_TICKER_US_TO_TICKS(EVENT_OVERHEAD_PREEMPT_MIN_US), so replace
usage of it by this constant
In addition, remove logic handling usage of XON_BITMASK since it
was only used by the long removed legacy LL
Signed-off-by: Troels Nilsson <trnn@demant.com>
The lost_payloads calculation in ull_conn_iso_start() could easily
end up negative for CIS with FT > 1; Add a check to avoid this
Signed-off-by: Troels Nilsson <trnn@demant.com>
Use `UINT_TO_POINTER` to convert a number to pointer.
Use `POINTER_TO_UINT` to get a number from a pointer.
Fixes#87527.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
When the GATT server is enabled the proxy advertiser
server need to be stopped. This solved a bug where the
Mesh Proxy Service is not restared.
This fix is done to fix several failing PTS test that
was failing when CONFIG_BT_MESH_ADV_EXT_GATT_SEPARATE
was enabled. Calling the stop_proxy_adv was left out
in a prevouis commit when doing code cleanup.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
The Generic Provisioning protocol requires that a transaction must be
acknowledged before the next Generic Provisioning PDU is processed
(section 5.3.3, MshPRT_v1.1).
In the current PB-ADV implementation, if there is an ongoing transaction
(link.tx.adv points to a valid advertisement), any received Generic
Provisioning Start and Continuation PDUs are ignored.
This creates a scenario where a remote device misses the Transaction
Acknowledgment PDU and retransmits the last PDUs, but they are ignored
by the local device because the local device has already started sending
the next Provisioning PDU.
In particular, in the observed failure, the Provisioner missed the
Generic Transaction Acknowledgment PDU during the transmission of the
Provisioning Data PDU.
This commit modifies the processing logic for Generic Provisioning Start
and Continuation PDUs by checking if the received PDU has already been
received. If so, it attempts to re-send the Generic Transaction
Acknowledgment PDU.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The options for BT_CTLR_CENTRAL_ISO and
BT_CTLR_PERIPHERAL_ISO did not have the proper defaults not
dependencies when BT_LL_SW_SPLIT=y
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Keep the err in code as it is convention in Bluetooth code, remove ret,
change error_code as avdtp_err_code for avdtp protocol error.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
The set size can now be dynamically set and notified.
The rank is added as a argument in the case that changing
the set size, also affects the device's rank, as ranks
in a coordinated set needs to be continuous.
The set coordinator implementation has been updated
to support receiving the new set size, and providing
this information to the upper layers.
This commit adds a babblesim test for the new API,
as well as a shell command.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The current overhead check needlessly flushes some events for
CONFIG_BT_TICKER_SLOT_AGNOSTIC resulting in some lost or incomplete
advertising events; Use a lower overhead value for this configuration
to avoid that
Signed-off-by: Troels Nilsson <trnn@demant.com>
For a CIG with a CIG Sync Delay larger than a SDU interval, we cannot
be sure that we can target the very next ISO event when the CIG event
is ongoing; Only reduce event_offset if CIG Sync Delay is smaller
than an SDU interval
Signed-off-by: Troels Nilsson <trnn@demant.com>
Add more parameters to command `connect` and `register`, including mode,
mode_optional, extended_control, and hold_credit.
Add command `credits` to give the rx credit.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add a sub-command set `l2cap` for command set `br`.
Move command `l2cap-register` to sub-command set. And rename it to
`register`.
Add command `connect`, `disconnect`, and `send` for command set
`l2cap`.
Remove original net buffer pool from `data_pool` to `data_rx_pool`.
Add a net buffer pool `data_tx_pool` for command `send`.
Do not wait anymore if no net buffer can be allocated from
`data_rx_pool`.
Dump all received data in L2CAP data received callback.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Improve the retransmission and flow control to support sending
multiple SDU at the same time if the TX windows is not full.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add mode optional support for BR l2cap connect initiator role.
If `chan->rx.optional` is true, set the mode to basic mode instead of
return error code `-ENOTSUP`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Enable signaling channel configuration for retransmission and Flow
control feature.
Send I-frame and S-frame. Support retransmission and Flow control for
sending.
Receive and handle I-frame and S-frame.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
ENTROPY_NRF_CRACEN_CTR_DRBG symbol is based on devicetree
node with compatible nordic,nrf-cracen-ctrdrbg. It does not
have to be selected explicitly.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
The stack will no longer implicitly set the data path
for ISO channel, and the responsibility for doing that is
now for the upper layers/applications.
This provides additional flexibility for the higher layers
as they can better control the values and timing of the data
path, as well as support removing and even reconfiguring the
data path at will.
This also removes some complexity from the stack.
This commit also fixed a inconsistency in the disconnected
handler. CIS for centrals as well as BIS were still valid
bt_iso_chan channels in the disconnected callback,
but CIS for peripherals were completely cleaned up at this
point. This issue is fixed by moving the disconnected callback
handling to before the code to cleanup the channel for
peripherals.
Since there is a difference in how you remove data paths
depending on the GAP role (central/peripheral), the
iso_info struct type has been expanded to be more
concise of which type of CIS it is.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use %zu for size_t and %zd for ssize_t, and don't use those specifiers for
any other type. Also make sure that field width specifiers get typecast to
the expected int type.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix connection update microsecond interval variable data
type, to use 32-bit so that a value upto 2000 seconds, i.e.
4 seconds interval and 499 peripheral latency can be stored.
Regression in commit abfe5f17a9 ("Bluetooth: Controller:
1 ms connection").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the following warning
att.c:734:3: warning: label followed by a declaration is a C23 extension
[-Wc23-extensions]
734 | k_tid_t current_thread = k_current_get();
| ^
By wrapping that code as a compound statement
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a function `bt_br_bond_exists()` to check if the address of the
classic device has been bonded.
Update release-notes-4.2.rst
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The API has not changed since it was introduced so should no longer be
considered experimental.
Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
Define macros for encryption value,
#define BT_HCI_ENCRYPTION_OFF 0x00
#define BT_HCI_ENCRYPTION_ON_LE_AES_CCM 0x01
#define BT_HCI_ENCRYPTION_ON_BR_E0 0x01
#define BT_HCI_ENCRYPTION_ON_BR_AES_CCM 0x02
Use the macros to replace the hard code.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>