Change so that num_completed_packets event handling is also
enabled for broadcast ISO only builds. This is because sending
data on a broadcast ISO still generates this event.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the function out of the ACL group as it may be used
for broadcast ISO only builds.
er 31045c7 was merged, it was possible to use broadcast
iso without CONFIG_BT_CONN, but it did not properly handle
TX and RX as there were missing support to read the buffer
size from the controller, as well as missing support
for handling the number of completed packets event.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Follow up on commit bfd45e5b8c
("drivers: remove Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME")
Remove Kconfig options
CONFIG_BT_UART_ON_DEV_NAME and CONFIG_BT_MONITOR_ON_DEV_NAME
since all UART drivers are converted to devicetree and we can just use
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart)) and
DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_mon_uart)).
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
There were missing commands in local supported commands list that
are related with connectionless direction finding.
The commands are implemented but they haven't been added
to HCI_Read_Local_Supported_Commands list.
The commit fixes that.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Move the implementation of scan trains after call to LLL
prepare, so that LLL prepare executes without any latency.
To increase radio utilization, LLL prepare should be
scheduled as early in the `ticker_cb` of the radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the return value use to indicate unassigned auxiliary
context when scanning is using LLL scheduling. This can
happen only under LLL scheduling where in LLL auxiliary
channel PDU reception has been spawn from LLL primary
channel scanning and on completion will join back to resume
primary channel PDU scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Keep the default AD Data length to Bluetooth Specification
defined minimum of 31 octets.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update the connected ISO API to be more
similar to the broadcast ISO API as well
as the HCI spec.
This updated API allows for more flexibility
and will better support scenarios such as true
wireless setup, as ISO channels and connections
are more independent now.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix implementation to not to put back the primary channel
scanning to resume state when Extended Scan has used ULL
scheduling which pre-empts the scan window.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Simplify implementation that clears extended scan response
data by moving the length check after the new PDU buffer
has been correctly initialized.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add check to validate PHY value in the Auxiliary Pointer
structure in the common extended header format.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The bt_sdp_get_add_proto_param is used to get the protocol
parameter from Additional Protocol Descriptor List.
In order to implement it, one parameter
(proto_profile_index) is added to sdp_get_uuid_data_index
to get the indexed item.
Fix one bug in sdp_get_uuid_data because there may be more
than 2 consequent "seq len item".
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Add a build assert if the device name has been misconfigured. The device
name has a max length of 248. When configured as dynamic make sure that
the initial device length can fit in the dynamic max length.
This prevents us from having to handle length overflow when setting
device name in advertising data which has an 8-bit length field.
Log a warning if failing to set the device name in bt_enable.
Remove unused defines in the shell.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix adv-data command when given arbitrary advertising data in
hexadecimal format. The data_len field should contain the length of the
data which does not include the data type. Instead the AD len field in
the data was given. This caused the AD len field to be increased by 1
in the advertising dat.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
In the case where keys are distributed on an unencrypted link,
we got the following call trace:
- bt_smp_recv()
- smp_error()
- smp_pairing_complete()
- bt_conn_security_changed()
- smp_pairing_complete()
- bt_auth->pairing_failed()
- smp_reset()
- bt_auth->pairing_failed()
- smp_reset()
To avoid the second call to bt_auth->pairing_failed()
we validate the that smp flags before calling the callback.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
(Re)setting the connection handle in hci_disconn_complete
should not be done as the handle are used for
logging/debugging purposes after this, and makes it
impossible to lookup the handle of disconnected
connections.
The connection handle is set to 0 during bt_conn_new
in any case.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
No initialisation will lead to undefined behaviour in check for
BT_L2CAP_RECONF_INVALID_MPS.
This is affecting L2CAP/ECFC/BV-23-C
Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
Fix missing synchronization when stopping primary and
auxiliary PDU scheduling.
Added implementation to ensure primary and auxiliary event
count match when terminating extended advertising on maximum
number of events or on duration.
Fixes#37571.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Max events and duration parameter are not used in high duty
cycle directed, hence correctly initialized them and not
depend on the caller of advertising start API to set them
to zeroes.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
unseg_app_sdu_decrypt decrypts messages in place using a single net_buf.
While this is safe in terms of data access, the buffer state is
manipulated with the assumption that they're two different buffers, and
the output buffer's length field is increased at the end. When
assertions are enabled and the pdu length is 11 or 12 bytes, this
triggers the net_buf length assert, as the decrypt function attempts to
add the pdu length to the out buffer, with the assumption that it was
reset before decryption was started.
Create a separate output buffer with len = 0 to avoid triggering the
assert. Improve readability of the unseg_app_sdu functions to highlight
the need for the additional buffer.
Fixes#37519.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Allow the application to configure the advertiser as scannable when it
does not provide scan data in the call to bt_le_adv_start. This makes it
possible for the application to later add scan response data in the
bt_le_adv_update_data call.
This aligns the legacy code path with the extended code path which
already had this behavior.
This also stops a directed connectable advertiser from being marked
internally in the host as scannable. This appears to not have been
causing any issues.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix non-connectable advertiser configured as ADV_SCAN_IND when
configured by application to have the device name appear in the
advertising data instead of the scan response data.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Disallow creating an extended scannable advertiser with the device name
configured to appear in the advertising data.
This would fail in either the call to bt_le_ext_adv_start or
bt_le_ext_adv_set_data when the host would try to set advertising data
in the controller.
Instead this now fails in the bt_le_ext_adv_create call.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
There is a problem with the previous method, that is,
we use the same label(bt_mesh_subnet_cb_subnet_evt) and
put it in the same section, which is not friendly for debugging.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
When device is first provisioned with IV Update
flag is set to 0, it should wait for minimum of
96 hours before going into IV Update In Progress
state. Such limit does not apply, if device is
provisioned with IV Update flag is set to 1.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
This commit adds missing API that allows to discard the Subscription
List of a vendor model.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Name length can't be longer than 8 bytes. This needs to be clarified
in the bt_mesh_model_data_store() documentation.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Change the fail handling of setting the CIG parameters
(or when allocating the CIS) to unref the ISO conns
instead of calling cleanup on them directly.
This fixes an issue that if the CIG parameters failed,
then the iso conns would not be unref'ed and we could
not try again.
Unref'ing an iso conn will call cleanup once it hits 0
refs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
A channel should only be allowed to unbind when in
the BT_ISO_BOUND state. If it is in a disconnected state,
then it the function would have meaning. If it is a connected
state, unbinding it would generate an error when removing
the CIG, which would fail silently.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
LE Set Connection CTE Receive Parameters HCI command size may not fit
into HCI TX command buffer size, which default value is 65 bytes.
For platforms other than Nordic there may be up to 75 antenna IDs
put into the command.
Added new default value for SOCs not compatible with Nordic to
extend default TX buf size to 83 bytes (75 bytes for antena IDs,
5 bytes for other command parameters, 3 bytes for command header).
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add functions that handle enable CTE request control procedure
request from host.
Implementation of ll_df_set_conn_cte_req_enable in ULL is partial.
It will be integrated with refactored implementation of control
procedures.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add struct ll_df_conn_rx_params sturcutre to struct lll_conn.
This is storage for parametrers required to configure radio
for CTE reception in connected mode by lower link layer.
Add required includes to make the controller code compilable
after change struct ll_conn.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
HCI_LE_Set_Connection_CTE_Receive_Parameters handling is required to
enable sampling of Constant Tone Extension in connected mode.
The commit adds handling for HCI_LE_Set_Connection_CTE_Receive_-
-Parameters command.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add struct ll_df_conn_rx_params sturcutre to struct ll_conn.
This is storage for parametrers required to configure radio
for CTE reception in connected mode.
Add required includes to make the controller code compilable
after change struct ll_conn.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add new strcture type for storage of CTE receive parameters.
The structure will be used in to store parameters for connected mode.
The parameters provided by HCI commands for receiving CTE
in connected mode and disconnected mode are a bit different.
There is common subset of parameters but extraction of those
into common structure would increase of size of other stuctures
that aggregate them.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Code related with connected mode was in middle between connectionless
RX and TX. Moved to the bottom of the file.
Added missing compilation guards for ll_df_set_conn_cte_tx_params.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add features: connection CTE request, connection CTE response
and receiving constant tone extensions; to HCI and features
supported by controller.
The features are not enabled yet.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
The way we currently handle direction finding extension (DFE) support
on Nordic nRF5 controllers relies on required devicetree properties
related to DFE in the "nordic,nrf-radio" node.
That doesn't make sense on radios without DFE support, though.
Any .dtsi for an SoC without DFE support which has such a node would
require extraneous DFE related properties like dfe-antenna-num.
Instead of making the properties required, mark them optional. We
indicate the presence of DFE support via a new 'dfe-supported' boolean
property which the SoC .dtsi files can set (or not) depending on
support.
This gives us the opportunity to do some cleanup in the Kconfig,
removing CONFIG_HAS_HW_NRF_RADIO_BLE_DF since we know from the
devicetree whether DFE support is available.
Handle that change appropriately in radio_df.c. This gives us an
opportunity to improve readability in the devicetree-related macro
magic in that file.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>