Connectable and scannable instances always have AuxPtr so we can return
error immediately if controller is configured with no aux.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Prevent redundant collision resolves and potential incorrect and harmful
increment of lazy_current.
During collision scenarios with high CPU load, the ticker_worker may be
called a second time before the ticker_job gets to run. This will cause
ticker operations on the previosly expired node (expected), and in some
cases increment lazy_current, even though the node was not sceduled to
execute via the req/ack mechanism.
By moving the request check before collision resolve, CPU time is saved,
and lazy_current will not incorrectly be incremented if node is in
collision.
The problem may be seen as a connection suddenly not receiving packets,
or MIC error on master, because the event counter goes out of sync.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Use a helper config BT_CTLR_CONN_RSSI_SUPPORT so that it is only
enabled when supported by the controller.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Those APIs are used for deleting appkey, unbinding an application
from SIG model, unbinding an application from vendor model on the
target node, with matching shell command.
Signed-off-by: YanBiao Hao <haoyanbiao@126.com>
When lazy loading of CCCs are enabled there is no settings set handler
register for the 'bt/ccc' key, this means that the settings set handler
for 'bt' key is called instead. This handler does not know what to do
for the 'ccc' subkey, and returns -ENOENT for the entry.
This results in an error message logged by the settings subsystem.
"E: set-value failure. key: bt/ccc/f8c39e2f98210 error(-2)"
Fix this by providing an empty handler for the 'bt/ccc' key when
Lazy Loading feature is enabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix periodic advertising delete implementation, to not
NULL the callback pointer when deleting the instance so
that the application's terminate callback can be called
thereafter.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Many #ifdefs can be removed, but the UNPROV_BEACON_INT Kconfig
variable needs to be also made available also. This is done by making
its prompt (user selectability) optional rather than the option
itself. This approach is fine for "parameter style" options, but
should probably not be used for feature enabling options.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
A build assert in dummy.c lists the following requirement:
[...] receive thread priority shall be higher than the Bluetooth
Host's Tx and the Controller's receive thread priority.
This is required in order to dispatch Number of Completed Packets
event before any new data arrives on a connection to the Host threads.
The drivers uses a priority that is equal to the Host TX thread,
and since they don't use the CONFIG define that is only available
to the controller then this BUILD_ASSERT will not catch the
requirement.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Adds a Config Client API for deleting netkeys on the target node, with
matching shell command.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Added a callback that lets an application get write error
(if any) when subscribing to a gatt characteristic.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Fix option USE_IDENTITY for bt_le_ext_adv_* API.
The random static identity address that was set in bt_le_ext_adv_create
was overwritten in bt_le_ext_adv_start in the call to
le_adv_set_private_addr.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add the nRF52805-specific file with radio related defintions.
Use also specific configurations for certain PPI channels used by
the controller, as this SoC has limited number of programmable PPI
channels.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Change hard-coded (D)PPI channel bitfield values to the BIT() macro
calls with the corresponding channel base value supplied as parameter,
to make it possible to actually change this base value if needed.
Remove unused *_EXCLUDE macros.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
nRF5340 does have SWI peripheral, hence use it instead of
the single available EGU peripheral. Use of SWI will allow
controller's LLL, ULL_HIGH and ULL_LOW execution context to
be independently configured to different interrupt priority
levels.
When ULL_HIGH priority equals ULL_LOW priority, only SWI2
is used by controller. Otherwise, SWI3 is used for ULL_LOW.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Detect and handle AD data set race condition between thread
and ISR context.
Fixes#27637.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add cpu_dsb() hal interface so that data synchronization
barrier be used in ARM Cortex M4 and M33 architecture
implementation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Set the AD data double buffer first index as volatile
because it is modified in LLL ISR context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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>
Changes the local network interface to exclusively handle packets for
the local interface, duplicating the buffers in the process.
The loopback mechanism now operates its own packet pool for the local
interface queue. The loopback is moved ahead of encryption, allowing the
local interface packets to go back up the stack without network crypto,
saving a full round of encrypt/decrypt for self-send.
Packets for group addresses the local node subscribes to are now
duplicated, with one unencrypted variant going into the network
queue, and the network bound packets following the regular path to the
advertiser.
Introduces one new configuration for setting the number of loopback
buffers.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
enable CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY:
In function `bt_le_oob_get_local':
subsys/bluetooth/host/hci_core.c:8878:
undefined reference to `bt_smp_le_oob_generate_sc_data'
Signed-off-by: chao an <anchao@xiaomi.com>
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>
The PA sync is now "deleted" (i.e. flags reset) before
the terminated callback is called, so that is
possible to create PA sync in the callback. One flag
was already cleared before for this reason, but one
other flag is also required, so we just clear
everything now.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Removed the check for explicit scanning, such that
an application may create a PA sync while explicitely
scanning.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.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>
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>
If `CONFIG_BT_CENTRAL` was enabled and the device was not scanning
or connected, then `bt_le_per_adv_sync_create` would not start
scanning for periodic advertisers.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Mark the ram version of the ccc_cfg as free after ccc has been
stored when a bonded device disconnects.
If the device use lazy loading of settings then ccc_cfg was not
cleaned up properly when a bonded device disconnects. This
resulted in the ccc system ran out of ccc_cfg resources after
having disconnected CONFIG_BT_MAX_CONN times.
Signed-off-by: Kim Sekkelund <ksek@oticon.com>
Step1: Move bt_gatt_disconnected() to avoid forward declarations which
otherwise would be needed by a fix to lazy loading cleanup on
disconnect in step 2.
Signed-off-by: Kim Sekkelund <ksek@oticon.com>
Since bt_l2cap_send_cb can fail returning its error is not enough as
the buffer has been modified to add the headers, so this save the state
before calling bt_conn_send_cb and takes a reference so it can be
restored its original state in case of error.
Fixes#27434
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-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>