Review rework, added comments, TODOs, FIXMEs and converted
magic number use in advertising set state flags to defines.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added comments and code to make note that disabling all
advertising sets is not yet implemented.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor pdu.h defined in anticipation of reused in
Advertising Extensions implementation. To reuse in
calculating ticks_slots etc.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix segmentation fault detected by BabbleSim test due to
incorrect number of tickers being allocated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Avoid ticker from null pointer dereferencing when storing
operation callback functions to be called during collision
resolution.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix scan set allocation using BT_CTLR_SCAN_SET instead of
an incorrect duplicate BT_CTLR_SCAN_MAX.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Integrate the generated extended adv report PDU list into
HCI layer to generate the HCI LE Extended Advertising Report
event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Change the implementation of extended scan PDU rx list to use
the extra pointer as the next field in the linked list node.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing Auxiliary PDU when primary PDU is calculating
the offset. Schedule the auxiliary PDU ticker before primary
PDU ticker is scheduled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the Low Latency Prepare Done that disables ULL_LOW
context executions inside a radio event, so that
ticker_job_idle_get is invoked from ULL_LOW instead of LLL
context so that its enqueued alongwith others scheduled
in ULL_LOW. This is avoid premature disable of ULL_LOW
context executions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When Privacy is not supported in the build and Advertising
Extensions is enabled, HCI LE Enhanced Connection Complete
event was missing. This is fixed now.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix incorrect adv_addr type in auxiliary PDU when address
is removed from primary and added to auxiliary PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to calculate the window widening for
the reception of auxiliary PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix to avoid a crash due to missing aux_ptr in current
primary PDU constructed by LE Set Extended Advertising
Parameter Set, while aux_ptr was populated by LE Set
Extended Advertising Data Set in the latest double buffered
PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to handle updates to adv mode and event
properties of an already created advertising set.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix collision resolution to consider single-shot ticker,
current single-shot with ticks_slot as older that a next
periodic or single-shot ticker with ticks_slot.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ticker to correctly generate the operation callback if
single-shot ticker fails to be scheduled and does not
expire.
As the collision resolution is deferred to the worker, if
a single-shot ticker is cancelled, then appropriately call
the operation callback with failure status. This is allow
the user to take necessary actions, like release resources
allocated that need to be release on the failure to schedule
the single-shot ticker expiry.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Move the definition of PKT_US into pdu.h so that it can be used
by Advertising Extensions implementations too.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove us_radio_rdy field in the footer structure as its always
a constant value which can be obtained using a functional
interface to HAL.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix legacy advertising started using Extended Advertising
sets to use the set advertising random address.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing reset of phy struct member for scan set that is
not being enabled by use of LE Extended Scan Parameter Set
command.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Allow use of HCI LE Set Random Address cmd when advertising
is enabled using Extended Advertising commands.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix, use phy variable instead of type to determine if
scanning on Coded PHY is to be enabled.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to generate LE Extended Advertising
Report for received legacy PDUs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing reset of scanner state which could cause a
spurious SCAN_RSP packet without a prior SCAN_REQ being sent
to be reported.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to support setting of legacy
Advertising Data and Scan Response Data using Extended
Advertising Data set functions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Differentiate call to ll_adv_params_set, whether used by
legacy LE Set Advertising Parameters or LE Set Extended
Advertising Parameters.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Enable Advertising Extensions features in the controller
when enabled in the Host in combined host+controller based
applications.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update implementation of periodic advertiser's LLL to
correctly handle event counter values when latencies
introduced due to sync events cancelled by active events
operating in unreserved time space.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update implementation of master and slave LLL's to correctly
handle event counter values when latencies introduced due to
connection events cancelled by active events operating in
unreserved time space.
When an active radio event extends into unreserved time
space, and a connection event prepare is scheduled but at
the time of pre-emption timeout if the connection event is
cancelled then the event count and latencies needs to be
continiued to get acummulated.
In the current controller usecases the above scenarios does
not get exercised, the changes in this commit is needed for
future roles that can extend into unreserved time space and
would cancel a scheduled connection event.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix conditional compilation of advertising extensions and
periodic advertising do that platforms with not support in
their LLL can be built without advertising extensions.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix conditional compilation of piggy back implementation.
This code should be deleted once periodic advertising
implementation is complete.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor to reuse common repeated code in ISR that reset
status, and performed abort, done and cleanup.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation to support ADV_EXT_IND PDU with AuxPtr.
Changes in this commit only prepares the ADV_EXT_IND PDU
in the primary channel.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Updated the shell commands related to Advertising Extensions
to call the LE Set Extended Advertising Data command
functional interface for testing purposes.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added debug information print outs in HCI code related to
Advertising Extensions events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add support for Bluetooth Controller GPIO Debug Pins for
nRF5340 PDK board. GPIO Pin toggling can be captured on the
P3 pinhead of the PDK.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Previous mode store function only can store single data,
change this to store as KV model, let's app-layer to manager
model data, other than by stack when node reset.
Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
Port advanced scheduling implementation from legacy
controller.
This implementation schedules
- non-overlapping scan window when there are simulataneous
central connections active
- central connection establishment with similar connection
intervals be placed in a non-overlapping group, temporally
- connection parameter request with calculated window offset
hints to have non-overlapping BLE radio events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add a function to reset the variable holding the connection
context of the currently active Connection Parameter Request
Procedure.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Address the nRF5340 Engineering A Errata 16, RADIO: POWER
register is not functional.
This affects the dependency of controller's HAL
implementation that expected correct reset values being
set in the Radio peripheral.
As the SUBSCRIBE_TXEN and SUBSCRIBE_RXEN where not in their
reset value, Radio transmission and reception start using
DPPI was broken.
Fixes#25942.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The bt_l2cap_le_conn_rsp struct in l2cap_internal.h has not been
declared __packed. This can cause alignment problems on some
platforms if the struct is placed on an unaligned address.
A __packed declaration solves this issue by forcing the compiler to
use store instructions that do not required alignment.
Signed-off-by: Jim Luther <jilu@oticon.com>
Implemented an intermediate decrypt buffer to cover the CCM
overrun under CRC error conditions. The workaround is
applicable to nRF52832 SoC only, which is missing the
MAXPACKETSIZE register in the NRF_CCM peripheral.
Fixes#21107 for nRF52832 SoC.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Adds propagation of error returns from the model init callbacks in
Access, and removing any other checks for successful init in the
foundation models.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Fix missing assignment of NRF_CCM->MAXPACKETSIZE register
for PDU sizes smaller than 251 bytes. If there is CRC errors
causing PDU length fields to be higher than configured PDU
buffer sizes in the controller, without the MAXPACKETSIZE
register set to correct PDU size, CCM module could overrun
the PDU buffer and cause memory corruption. This fix is
applicable for all nRF52 Series SoCs except nRF52832 SoC.
Fixes#21107.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
After removal of legacy controller ll_adv_aux.h does not exist anymore.
This is fixed in this PR by including ull_adv_aux.h instead.
The error only shows up when Advertisement Extensions are enabled
in the LL (CONFIG_BT_CTLR_ADV_EXT=y)
Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
CC: mesh/access.c
mesh/access.c: In function 'model_has_dst':
mesh/access.c:483:10:
warning: returning 'u16_t *' {aka 'short unsigned int *'} from
a function with return type '_Bool8' {aka 'unsigned char'} makes
integer from pointer without a cast [-Wint-conversion]
483 | return bt_mesh_model_find_group(&mod, dst);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: chao an <anchao@xiaomi.com>