Users will usually not want to browse through these. Therefore it is
better to hide them a bit.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This prevents GATT service selection being selectable when compiling
controller only builds.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Closing a listening socket will set the accept callback to NULL.
This could lead to a crash, in case an already received packet,
finalizing the connection handshake, was processed after the socket was
closed. Thereby, it's needed to verify if the callback is actually set
before processing it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The verification function for accept() did not take into account that
addr and addrlen pointers provided could be NULL.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a new API that allows to register a callback that is called when the
maximum latency value changes. This can be used by SoC code to perform
actions based on certain latency values.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a new API that allows to configure maximum latency requirements.
When the policy manager computes the next state, it will check if the
state brings too much latency based on requirements. This can be useful,
for example, if a certain driver or the application want a system to
respond fast, since any low power state that brings too much latency
will not be used.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The state lock get/put calls should always be balanced: first call get
and then put. Add an assertion in case lock counter is about to go
negative, indicating a programming error.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The pm_constraint_* APIs were effectively used by the policy manager
only. This patch renames the API to the policy namespace and makes its
naming more explicit:
- pm_constraint_set -> pm_policy_state_lock_get()
- pm_constraint_release -> pm_policy_state_lock_put()
- pm_constraint_get -> pm_policy_state_lock_is_active()
The reason for these changes is that constraints can be of many types:
allow/disallow states, impose latency requirements, etc. The new naming
also makes explicit that the API calls will influence the PM policy
behavior.
All drivers and documentation have been updated accordingly.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Most include files were not used, and `toolchain.h` was missing (needed
by `__weak`).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
1. state < PM_STATE_COUNT: the function argument is an enumeration that
already indicates the valid values. It is a programming error to pass
random integer values, the API should not be defensive "just in case
the application has messed things up".
2. v < UINT_MAX: first, this assumes type used by `atomic_t` (opaque).
Second, if the integer overflows it will just wrap around, so the
check does nothing in practice.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The policy file does not perform any logging, so just drop logging
include and declaration.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move policy code one level up for simplicity, since there is a single
source file. Source file has been renamed to "policy.c" to make things
clear.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The residency policy, is in reality, influences by other parameters for
example constraints. It has been renamed to "DEFAULT" policy to make it
more general. The "APP" policy has been renamed to "CUSTOM" to better
represent its purpose.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
TCP processed IPv4/IPv6 packets w/o verifying first if IPv4/IPv6 is
enabled in the system. This could lead to problems especially for IPv6,
where in case it's disabled the sockaddr structure is not large enough
to accomodate IPv6 address, leading to possible out-of-bound access on
the sockaddr structure.
Fix this by adding appropriate checks where applicable.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Create wrapper for printk to avoid including printk.h in __assert.h.
__assert.h is used everywhere thus should not have dependency to
printk.h.
Cleanup assert Kconfig options.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added support for Composite observation for LwM2M v1.1.
Updated current Observation node to support linked path list.
Rename typos lwm_ to lwm2m_.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Removed to store pmin and pmax at oberservation node structure and
use attribute list store for calculate time for next Notification.
Observation class use timestamp for triggering notification based on
resource update which use pmin and default pmax behaviour.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
There are no more context defines specific to metadata, the ones
coming from Assigned Numbers shall be used.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Delay start of threads and timer to ensure that setup
is completed. Especially, vital on multiple CPUs.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
TCP module can report EAGAIN in case TX window is full. This should not
be forwarded to the application, as blocking socket is not supposed to
return EAGAIN.
Fix this for sendmsg by implementing the same mechanism for handling TX
errors as for regular send/sendto operations.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Instead of including from nrfx_glue.h a specific Zephyr Bluetooth
controller header file that defines PPI and GPIOTE resources to be
reserved for exclusive use by the controller, include a file with
only a fixed name and expect the chosen Bluetooth controller to
provide the location of this file in include paths. This way, when
a different Bluetooth controller implementation is used downstream,
a different file can be easily pointed to.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The enum did not contain an entry for unconfirmed messages. Instead, it
was only mentioned in the comment that 0 is the default for
unconfirmed messages.
This commit adds LORAWAN_MSG_UNCONFIRMED to the enum and changes the
parameter in the lorawan_send function to enum lorawan_message_type.
Signed-off-by: Martin Jäger <martin@libre.solar>
When queue mode is enabled, state machine will enter state
ENGINE_REGISTRATION_DONE_RX_OFF. This state needs to be
taken into account during registration update to send
correct event.
Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
Following #42026, the body_start pointer now points to the
start of the body fragment in the recv_buffer as long as there
is body in it, either entirely or partially.
Rename the body_start to body_frag_start to better reflect
what it represents.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This fixes data path configuration that was done for both directions
even if CIS was unidirectional. To ensure the data path shall be
configured, the QoS SDU is checked.
Fixes: #43190
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Removing backend config from board Kconfig.defconfig and moving
it to xtensa_sim backend configuration in logging. Without this
change define persisted even when logging was not using backends
and that impacted what is compiled in.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Removing backend config from board Kconfig.defconfig and moving
it to native_posix backend configuration in logging. Without this
change define persisted even when logging was not using backends
and that impacted what is compiled in.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Extended logging v2 to support frontend api. Contrary to v1,
it is possible to have frontend and backends in the system.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Rename
BT_CTLR_LLCP_PROC_CTX_BUF_NUM
to
BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
to match naming scheme of
BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Add a separate procedure context pool for remote initiated procedures.
Make it configurable in size by BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM.
Fix all unit tests referring to the amount of free context buffers.
Fixes#41823
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Move the mem_pool structure to the internal header for wider access.
Introduce a mem_pool owner in the proc_ctx, sch that multiple mem_pool
could be used for memory management of proc_ctx, also static 'foreign'
allocated proc_ctx would be supported by this.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
When padding is added to "fill" the gap in order to wrap to the
beginning of the ring buffer, such padding is attributed to the
current item being added. Let's attribute it to the previous entry
instead so it'll be freed along with that entry and make the space
available one entry sooner, increasing the chances for keeping the
current entry around longer.
If ring buffer is empty then always reset it up front to get best
alignment right away i.e. beginning of buffer.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
The `handle_signal()` function in the new ztest API (`ztest_new.c`) uses
an array of strings to lookup a friendly name for each test phase, but
the array only has three elements despite there being six test phases.
This can lead to an out-of-bounds issue. Replace the array with a helper
function and switch statement.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Start of the antenna switching and sampling CTE is configured by use
of DFECTRL2 register in Nodric Radio peripheral. As of now the
configuration was set to defaults, so antenna switching has started
immediately after CTE procedure was started (end of CRC).
Sampling was started at the very beginning of a sampling slot.
It should be delayed for at least 125 ns from beginning of sampling
slot and not more than 125 ns to the end of sampling slot. This is a
requirement from BT 5.3 Core specification Vol 6, Part B section 2.5.4
IQ sampling.
Although it seems to me that when samples are taken depends on
implementation and used hardware. Taking that into account
there is provided a set of KConfig options to configure samples
offset for PHY 1M, PHY 2M and sapling slots 1 us and 2us separetely.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
If there is enabled support for ADI in periodic advertising and
periodic advertising uses chained PDUs there is an assert when
periodic advertising is re-enabled.
There is missing a code that will set a chain for PDU with
updated ADI field.
The commit fixes the issue.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>