Fix the auxiliary pointer and sync information offset and
offset unit population. Offsets are 13-bit value, use 300 us
offset unit when offset value using 30 us offset unit does
not fit in 13-bits.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Minor print format update, updated format for Periodic
Advertising Interval, and added SID to be printed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add the missing resources like ticker instances, Rx PDU
buffers and memory queue link buffers, that are required
for Periodic Advertising Sync creation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove the redundant ticker update check, ticker is not
stopped and started in Periodic Advertising unlike in a
Connection Update Procedure in connections.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Replace printk in ISR with BT_WARN to avoid problems with
co-existing with logging subsystem.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove generation of Periodic Sync Lost HCI event generation
that is not needed as per BT Spec. v5.2 Vol.4 Part E.
Section 7.8.69.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix uninitialized rl_idx value for the Extended Advertising
PDU received in the auxiliary channels. This caused
uninitialized rl_idx to be used by HCI layer and fail an
assert check in ull_filter.c file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing periodic advertising start due to missing
allocation of auxiliary context when no Extended
Advertising PDU on auxiliary channels.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Remove conditional compilation on structure definition in
pdu.h so as to allow inclusion of header files with
function prototypes that use those structures. I.e. to
avoid conditionally including the header file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to perform Periodic Sync Terminate,
generation of Sync Lost on terminate and on remote device
termination of Periodic Advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added implementation to handle Periodic Advertising clock
drift in the created Periodic Advertising Sync instance.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix auxiliary channel scanning to capture the PDU end
timing that is need to correctly setup Periodic Sync.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fill the correct local clock accurracy in the Sync Info
structure in the Periodic Advertising.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out drift compensation implementation so as to
reuse it for Periodic Sync feature.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added initial implementation of setting up of Periodic Sync
and scheduling the Radio Events.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out common lll_abort_cb function so that it can be
used across Periodic Advertising and Periodic Advertising
Sync creation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor out clock ppm interface so that it can be reused
for Periodic Advertising Sync feature.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added test implementation for test driven development of
Periodic Sync feature support in the controller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This adds a Kconfig option for enabling post-mortem mode of SystemView.
This is useful for crashes that occur after a longer period of time.
Signed-off-by: Mattia Fiumara <mattia.fiumara@bgrid.com>
Simple change that makes fs_seek and fs_tell return -ENOTSUP when
file system does not implement the seek/tell.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Don't use the ATT structs that has contains only a flexible array
member. This is not supported by C99 standard, only through GNU C
extension with zero length array.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
With only single RX buffer there is a high chance that such buffer will
not be processed before new bytes come in over UART. This is why it is
good to have at least two buffers, one which can be processed by SMP
layer, while another is being filled with new incoming bytes.
Add Kconfig option which allows to configure multiple buffers filled
with received UART SMP fragments. Use default value of 2, so we can
safely process already received frame in thread, while new fragment
comes in concurrently.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
So far there was a simple char array used as buffer, with additional
variable representing number of bytes already written into it. After
full frame was written, a boolean flag was simply set to notify thread
about being ready to be processed. There was however no mechanism
implemented to prevent new incoming bytes from overwriting such buffer
before (or during) being processed.
Use net_buf to store temporary frame. Define dedicated net_buf_pool,
from which such buffer will be allocated and freed after being
processed. This will prevent from reusing the same buffer before having
it fully processed (and returning once again to available buffer pool)
in shell thread.
Define also fifo that will store buffers that are ready to be
processed. This will be the mechanism for notifying thread about new
UART SMP fragments.
net_buf pool and k_fifo are used on purpose, keeping in mind their
additional overhead (mostly in RAM/ROM usage). This makes the code ready
for increasing number of buffers if needed. In this commit however we
stick with only 1 buffer, to keep minimal changes in processing flow.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Code should be using k_spinlock_key_t and not 'struct k_spinlock_key'.
With recent change to redefine struct k_spinlock_key we see this code
break because it wasn't using the correct type.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Testing the sample with Zephyr SDK 1.14 (vs 1.13) with qemu_x86
showed that it consistently crashes on 2th-4th iteration. Avoid
bite-sized increase this time, and dump stack considerably to
avoid constant need to update it.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>