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>
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>
Fix implicit declaration warning for peripheral_latency_cancel
by moving it to ull_slave file.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
So far, `LWM2M_RD_CLIENT_EVENT_BOOTSTRAP_TRANSFER_COMPLETE` event was
reported before the final ACK for the Bootstrap Finish was sent from the
client side. This could cause delays in the ACK sending, in case the
application wanted for instance to store the received data in flash.
Fix this, by reporting the
`LWM2M_RD_CLIENT_EVENT_BOOTSTRAP_TRANSFER_COMPLETE` event on the next
state tansition (before the actual registration starts).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
"Public Key or Identity" resource is of opaque data type, therefore it's
not correct to assume it will be a NULL terminated string (the existing
servers, for instance Leshan, does not include NULL terminator). Use the
actual size associated with the resource instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
So far, the resource instance structure kept only the information about
the buffer length provided to the resource (in the `data_len` field).
While this approach might be enough for integer resources, where the
actual data size is fixed, it did not work for opaque resources. It is
impossible to determine the actual opaque resource length after it's
been written into.
Fix this, by replacing the current `data_len` field of the
`lwm2m_engine_res_inst` with `max_data_len`, indicating the buffer
size, and making the `data_len` field to hold the actual data size of
the resource.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Currently, after `CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP` is enabled,
the LwM2M engine will initiate bootstrap procedure on each run. This
approach limits the flexibility of the application, as it's not always
necessary to go over the bootstrap procedure (for instance, the
application may decide to store the security object obtained during the
bootstrap in flash, and restore it on boot).
Fix this by introducing an additional `flags` parameter to the
`lwm2m_rd_client_start()` function, which provides information whether
to run bootstrap in the current session or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
So far, the LwM2M state machine started in the `ENGINE_INIT` state,
which made it exectue the registration/bootstrap registration even when
`lwm2m_rd_client_start()` was not called. With a new `ENGINE_IDLE`
state, the state machine can wait for the application to actually start
the client before proceeding. It also makes sense to stay in the
ENGINE_IDLE state after successfull deregistration, until the
application restarts the client.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Without removing the stale address obtained during IPCP, it will still
be present the next time we do IPCP, marked as "in use" by the network
stack even if it is stale. This turned out to be a showstopper for
restarting the PPP stack on devices without static IP.
Signed-off-by: Benjamin Lindqvist <benjamin.lindqvist@endian.se>