Refactor out into function the filling of sync info
structure in the common extended advertising payload format
header.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out into function the filling of aux ptr structure
in the common extended advertising payload format header.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out into functions the calculation of common
extended advertising payload format header length.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Moved the assignment of PDU length out side of a conditional
so that code to calculate PDU length can be reused.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out sync info field population into a utility
function with set and clear interface to add or remove
the common extended advertising header format fields.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
It fixes:
../../../../include/toolchain/gcc.h:169:30: warning: statement will
never be executed [-Wswitch-unreachable]
169 | #define __fallthrough __attribute__((fallthrough))
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Fix conditional compilations that fail when combinations
of Broadcaster, Observer, Peripheral and/or Central are
selected to build an application.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Return BT_HCI_ERR_INVALID_CONN_ID if an invalid handle is
given by the HCI; currently sometimes BT_HCI_ERR_CMD_DISALLOWED
is returned
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
Core 5.2, Vol 4, Part E, section 5.3.1 clarifies that advertising set
handle is assigned by host when advertising set is created and this
happens only on LE Set Extended Advertising Parameters.
An advertising set handle is an arbitrary number within allowed range,
i.e. 0x00-0xEF and not 0..max_supported-1.
This patch adds option to enable advertising set handle mapping from
HCI range as defined by Core specification to zero-based handles used
by LL. If enabled, HCI handle will be remapped to LL handle for each
command, otherwise HCI handle will be used as an LL handle. The latter
effectively skips mapping logic and should be used with Zephyr host
which uses zero based indexes.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
There's not need to mark advertising set as created by either legacy
or advertising command since this is determined by current so-called
HCI advertising mode which determines whether host uses legacy or
extended advertising commands.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
As per Core 5.2, Part B, section 3.1.1 controller should not allow
mixing of legacy and extended advertising commands. Once 1st command
is received from host, we should only allow commands of the same type
and return an error on other commands.
If legacy advertising interface is selected by 1st command received,
we need to make sure that set with handle=0 is created since it's
used by all legacy commands.
When not using external host, we assume that only extended advertising
interface will be used thus all checks can be skipped (optimized and
compiled-out).
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
A lot of commands return CC event with status parameter only, especially
when error is returned. This patch adds a helper to create such event,
similar to cmd_status.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Proper error code should be returned if advertising set with given
handle does not exist instead of generic "invalid parameters" one.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
AdvA in extended advertising PDUs is put at different offset than in
legacy PDUs thus it's better to let caller calculate and pass AdvA and
TxAdd explicitly. This way we won't need to check whether scan request
was on legacy or extended PDU every time.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
When a connect indication contains a channel map of all zeros, the
adv->conn is left NULL'ed after return and next connect attempt leads
to a crash.
This was identified via the Sweyntooth test suite executing the script
re. issue 6.14 towards an Oticon target.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
It does not auto-initiate the DLE procedure if the default data length
parameters are not equal to the initial parameters.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Fix incorrect use of LLL ticker user id in ULL_LOW execution
context.
Regression introduced in commit 23ef75f6d9 ("Bluetooth:
controller: split: Fix Low Latency Prepare Done").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fill the referenced event counter of the Periodic
Advertising SYNC_IND PDU into the sync info struct in the
Common Extended Advertising Header Format.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fill the missing Periodic Advertising interval in the
Extended Advertising Report when Auxiliary PDUs contain
Sync Info fields.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move implementation of hci_driver.h exposed functions to a common file.
The functions exposed by hci_driver.h header file is implemented in
either hci_core.c, or hci_raw.c. But since these functions would be
identical for both implementations have them in a new file that is
included for both.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Defined struct in node rx for passing event parameters of
Advertising Set Terminated Event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Implementation of Advertising Set Terminated Event on
duration sans use of additional variable in advertising
set context structure.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Updated implementation to have consistent initialization of
ret_cb use when passing it to ticker function calls.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
By splitting it out to a separate file, it will become easier to
separate generic and non-generic controller features.
This commit only contains the simple extraction.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>