This adds support for the following Direct Test mode
commands:
- HCI LE Receiver Test [v3]
- HCI LE Transmitter Test [v3]
- HCI LE Transmitter Test [v4]
Those commands set add a possibility to test an CTE
reception and transmission. The HCI LE Transmitter
Test [v4] commands allows also setting a transmit power.
Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
If peer sends invalid data length in response IUT should fix those
when calculating effective data length.
This was affecting following qualification test cases:
LL/CON/PER/BI-10-C
LL/CON/PER/BI-11-C
LL/CON/PER/BI-12-C
LL/CON/CEN/BI-07-C
LL/CON/CEN/BI-08-C
LL/CON/CEN/BI-09-C
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
http_client_req() was supposed to return the number of bytes sent as a
HTTP request. The return value was not riht however due to some bugs in
helper functions:
* http_send_data() returned the current buffer position istead of the
number of bytes actually sent. This could result in counting the same
data into the total request size several times. A helper variable was
added to track how many bytes were actually sent to the network.
* http_flush_data() forwarded the return value of sendall() helper
function. That function however did not return number of bytes sent,
but 0 or a negative error code.
Additionally, change the return type of sendall() function - according
to standard the ssize_t type is only capable of holding -1 negative
value, but the function could return the full range of negative errno
values. Use int instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Using a const-qualified object in a static initializer is implementation
specific in C, and it does not work in GCC 7.
Before this change, `write_appearance` was a pointer object if
CONFIG_BT_DEVICE_APPEARANCE_GATT_WRITABLE was disabled. This change
removes that object in favor of a macro `GAP_APPEARANCE_WRITE_HANDLER`.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Avoid pre-empting scan window when extended active scanning.
If a scan request has been transmitted, then avoid being
pre-empted at the end of window when in continuous scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix power amp for transmitting of chain scan response
wherein capture of PDU end timestamp was missing causing
power amplifier from not being enabled for first chain PDU.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The EATT support is optional for BAP. The specification mandates the
minimum MTU supported to be 64 bytes.
As per BAP_v1.0
"The Unicast Server shall support a minimum ATT_MTU of 64 octets for
one Unenhanced ATT bearer, or for at least one Enhanced ATT bearer
if the Unicast Server supports Enhanced ATT bearers."
The same applies for other BAP roles.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Fix auxiliary context from being flushed when scanner or
periodic synchronization is stopped, to avoid using the
disable_cb by both. Fixes an assertion when this race
condition happens.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not enqueue NODE_RX_TYPE_RELEASE into Auxiliary context
when stopping scanner, as this type is not to be passed to
HCI processing, which would lead to assertion.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix auxiliary context leak on stop, under race condition
where ULL High execution context does not release the
auxiliary context as stop has been requested, and done
has decremented the auxiliary context's reference count.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the order of Periodic Synchronize reset during HCI
Reset Command. Perform scan reset last after Periodic
Synchronize reset to avoid resetting the auxiliary
context which may be in use by Periodic Synchronize.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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>