Add public function to set Constant Tone Extension transmission
enabled or disabled for periodic advertising.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Enable CTE HCI command requires update of a state of its
execution after receive command completion response from
controller. Host has already implemented such functionality
but it was used only internally by hci_core.
This commit changes it to be accessible from other sourece files
in host.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add implementation of HCI_Set_Connecitonless_CTE_TX_Enable
command to HCI. Add scratch implementation of command handling
functions to controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Fix compilation error caused by missing header files.
Reorganized order of header files include.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Correct names of kconfig entries to mach to style of other entries.
Style correction in hci.c. Use the same approach of checking if
Kconfig entry is enabled.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
MESH/NODE/CFG/HBS/BV-01-C expects the MinHops to be 0x7f after
disabling subscription, but 0x00 for subsequent Get requests.
MESH/NODE/CFG/HBS/BV-02-C expects us to return previous
count value and then reset it to 0.
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
This is a pairing function with bt_le_scan_cb_register()
to used for remove the scanner callback from callback list.
Signed-off-by: chao an <anchao@xiaomi.com>
Fixed misalignment of bitflag in ll_conn type causing unintentional
overwrite between unions. Common flag must be present in master/slave
uinons as well. Problem is only present when enabling feature
CONFIG_BT_CTLR_CONN_META, which is default disabled.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Reserve two link rx buffer for each supported Broadcast ISO
sync instance, for establishment and for sync lost node rx
generation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For tx_power_max_get and tx_power_floor, only allow for
positive values of txpower if they are defined.
Signed-off-by: Aurora Sletnes Bjørlo <aurora.sletnes@nordicsemi.no>
Rename Kconfig BT_CTLR_SCAN_SYNC_ISO_MAX to
BT_CTLR_SCAN_SYNC_ISO_SET, to be consistent with other
Kconfig naming.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
AUX_CONNECT_RSP PDU static buffer definition was missing one
byte required for the Extended Header Flags.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Document with comments, the explanation of node rx count and
the design of the free rx PDU management.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix for scenarios where in active PHY Update Procedure or
Connection Update Procedure could cause temporary depletion
of the free Rx PDUs in the queue between LL/HCI thread
context to LLL context. Symptoms being on-air NACKing during
the above said procedures, causing supervision timeouts due
to procedures not completing at instants.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor the implementation of PA/LNA PPI configuration
which was done on every Tx or Rx as common code to be
executed once per radio reset. And only setup the timeout
and enabling of PPI at every Tx or Rx.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
For PA/LNA implementation use NRF_P0/P1 defines instead of
the deprecated NRF_GPIO to reference GPIO Port 0 registers.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the missing GPIOTE channel disable when GPIOTE channel
is alternately used between PA and LNA use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in PA/LNA support wherein the GPIO pins where
left in undefined state after each radio event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression, add back missing call to radio_setup HAL
interface. This is needed to setup the initial PA/LNA GPIO
states.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix crash in ATT when the response for a request is received after
the ATT timeout has fired and the ATT channel has been detached.
Add similar handling for all ATT channel operations.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
SWI IRQ line mapping for nRF5340 shall use
CONFIG_SOC_NRF5340_CPUNET for conditional compilation
instead of the board define, so as to allow new boards to
use the BLE controller implementation.
Fixes#30488.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add publicly accessible function to set Constant Tone Extension
parameters for CTE transmission with periodic advertising.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add implementation of a wrapper for HCI_LE_Set_-
Connectionless_CTE_Transmit_Parameters send command.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add Direction Finding to host initialization sequence.
It allows to get information about Direction finding
optional CTE settings supported by controller.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Remove is_enabled flag in LLL of BIS events context, as the
status returned from ticker_stop interface is sufficient to
determine if the Broadcast ISO Sync was established or not.
HCI Command Disallow as reason is to be returned if sync was
not established or sync was loss prior to call of HCI LE
BIG Terminate Command was called.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move lll_sync_iso.h as common to all vendors, as currently
there is nothing that is vendor specific.
Fixes#31044.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When using BT_GATT_AUTO_DISCOVER_CCC if the ccc_handle is not set
bt_gatt_subscribe would initiate a discovery to locate the CCC handle
but instead of awaiting it to complete the code does proceed to call
gatt_write_ccc even with ccc_handle being 0x0000 which is invalid.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
We have convenient PHY_1M, PHY_2M and PHY_CODED symbols defined but
they are not used too much in the code. This replaces all usages of
magic numbers and other symbols as PHY constants with those symbols.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Adds an assert on the "old" ref counter when doing unref, that
checks if there indeed is a reference to unref. This prevents
any underflows of the ref counter.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implements the ull_sync_iso_setup function which starts the
ticker for ISO sync. Furthermore, ll_big_sync_terminate
will not stop the ticker as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implements handling of the BIG sync commands in the ULL.
LLL support and handling of ACAD (biginfo) remaining.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adjust the PPI used by nRF51x and nRF52x so that PPI 0-5 is
available for application's use or for SW PWM driver use.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Under CONFIG_BT_TICKER_EXT configuration, the ticker interface has been
extended to support enabling/disabling must-expire scheduling. This
means that conn and slave ticker start calls can now omit must-expire
default-on configuration, relying on LLL updating the mode as needed.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Align bt_le_per_adv_sync_get_index, bt_conn_index and
bt_le_ext_adv_get_index in use of uintptr_t.
This fixes an issue where the cast to uint8_t happened before the
assert for a valid index, which could lead to invalid pointers passing
this assert.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Improve logging of pairing procedure when it fails with error code
unspecified. Since this is returned in many places debugging this
failure is not easy without adding additional debugging.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix parallel pairing procedures using LE SC requiring the DHKey
calculation at the same time. This would otherwise end all other
pairing procedures with the SMP error code "unspecified" since
the call to bt_gen_dh_key would fail.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Set the allowed command bitmask before sending the SMP packet. This
avoids a race-condition in case the sending of the PDU made the
current thread not ready and would not be scheduled back in time
to set the bit before receiving the next SMP packet.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Improve multiple DHKey handling by allowing the next DHKey calculation
to be started in the dhkey ready callback.
Return error code EALREADY if the provided callback is the current
callback generating the DHKey.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
We allocate nodes on receiving AUX_CONNECT_REQ, but we can only use
them if AUX_CONNECT_RSP is sent successfully. If that fails, we need
to release those nodes.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
If we allocate a node in LLL and it turns out that we don't need it
(e.g. allocated connection on AUX_CONNECT_REQ, but connection handshake
did not complete and we don't need it) we still need to send it to ULL
to be released. We can use existing NODE_RX_TYPE_DC_PDU_RELEASE node
type for this purpose, but we just need to make sure it's passed from
LLL to ULL properly.
Also, since this now does not only release DC PDUs, let's change its
name to a more generic one.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
After slave connection is created only adv instance is stopped, we also
need to stop aux separately if enabled.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>