When waiting for response after receiving the empty Ack, client
actually used way too timeout.
CoAP timeout only holds the timeout value in ms. t0 is the starting time.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Aligns subnet bridge related commands according to conventions used for
rest of the shell commands. Also updates documentations to reflect the
change.
Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
TASK_SHUTDOWN was deprecated in newer SOCs and now removed
in MDK 8.68 (nrfx 3.9.0)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Change the select to a depends on for the Kconfig options
for HAS and HAS_CLIENT.
This is an effort to reduce the number of selects used by
LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Change the select of BT_PER_ADV_SYNC and BT_EXT_ADV to
depends on. This is an effort to reduce the use of
select for Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify ASCS and BAP Broadcast sink to depend on the PAC options
instead of selecting them.
Since Kconfig does not support "depends on X if Y",
a select for PAC_{SRC,SNK} is used depending on
ASCS_ASE_{SRC,SNK}.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP Kconfigs option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The BAP_BROADCAST_SOURCE Kconfig option now depends on
BT_ISO_BROADCASTER instead of selecting it.
This is an effort to reduce the use of select in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the selects and use def_bool for BT_AUDIO_RX and
BT_AUDIO_TX.
This is part of an effort to reduce select in Kconfig.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify the Kconfig options to depend on the GATT
features rather than selecting them.
This is part of an effort to reduce the amount of
selects we use in LE Audio.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Remove the selects from BT_BAP_UNICAST_SERVER and BT_BAP_UNICAST_CLIENT
and use a def_bool for BT_BAP_UNICAST.
This is part of an effort to reduce select in Kconfig.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Addresses in cmd_load() should always be unsigned. Previously, strtol()
was used, which is limited to signed long values, causing issues with
addresses >= 0x80000000. This commit replaces strtol() with strtoul(),
ensuring proper handling of the full 32-bit address space.
Fixes#81343
Signed-off-by: Aaron Fontaine <aaron.fontaine@dojofive.com>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
As long as MBEDTLS_ENTROPY_C is enabled, Mbed TLS needs to
poll some entropy source to gather data that will then be
processed by CTR/HMAC-DRBG modules. This means that in most
of the cases, once MBEDTLS_ENTROPY_C is enabled then also
MBEDTLS_ENTROPY_POLL_ZEPHYR needs to be enabled. This was
done manually until now, as the long list of samples/tests
demonstrate.
This commit solves this dependency by defaulting
MBEDTLS_ENTROPY_POLL_ZEPHYR to on as soon as
MBEDTLS_ENTROPY_C is set. As a consequence, all manual
enablement of MBEDTLS_ENTROPY_POLL_ZEPHYR in samples/tests
are removed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
802.11 doesn't have specific constraints, it just says that listen
interval should be >=0 and it a 2 byte field.
3 as a typical DTIM value from nRF chipsets, so, remove the hardware
specific line and just set a failure.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The pull context LwM2M client's set_socketoptions callback is currently
unused and can't be set by a user. Add a public API to set the
pull context's client's set_socketoptions callback.
Signed-off-by: Andi Gerl <andi.gerl@exacttechnology.com>
When linking and relocations are performed on the ELF object itself
with no copying, also global binding linking can break references.
Disable linking globally for such cases.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Set Address behavior is not specified when wValue is greater than 127,
or if wIndex or wLength are non-zero. USB stack did check wValue and
wLength but didn't care about wIndex value. Extend the check so non-zero
wIndex also results in STALL response.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Adds support for using relay buffers and advertising set for the subnet
bridge feature, even if the relay feature is disabled.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
In order to support error and warning message coloring
LOG_BACKEND_SHOW_COLOR must be set. Allow setting it for
customized cases.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The variables 'first' and 'next' in function 'stats_buffer_list_first()'
and 'stats_buffer_list_next()' were potentially used uninitialized.
Depending on the compiler and target architecture, this can lead to
different behavior, including warnings or errors when using strict
warning flags.
By initializing these pointers to 'NULL', we ensure consistent and
expected behavior across all toolchains and configurations.
Signed-off-by: Fabian Kainka <kainka@cognid.de>
Platform capability descriptors such as MSOSv2 or WebUSB BOS have a
vendor request code that is used by the host to perform vendor-specific
requests. Add a convenient way to define and register a platform
capability descriptor with a vendor request node.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Allow the user to register a vendor request node identified by the
vendor code (bRequest) and containing two callbacks to handle the vendor
request. The device stack uses the vendor request node to call the
vendor request callbacks when it receives a request of type Vendor,
recipient Device, and bRequest value equal to the vendor code.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
When start to sending proxy advertising, will also process in
send_pending_adv, but the bt_mesh_adv_get_by_tag will directly return
buffer from bt_mesh_adv_queue or bt_mesh_relay_queue, which case
mesh messages sent on different sets, can cause peer replay attack.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
PM_DEVICE_FLAG_ISR_SAFE is an enum and it must be converted to
a bit mask before masking with flags.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
CONFIG_TEST_USERSPACE should select CONFIG_USERSPACE as they
should be enabled together. It is no use to enable userspace
tests without enabling userspace.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Make sure that we cannot connect to IPv4 multicast or broadcast
destination address for a TCP socket.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This is helper is only needed in socket multicast interface selection
where we need to get one address from the interface so that it will
tell (when getsockopt() is used), the interface IPv4 address where
multicast packets will be sent. This is private function which is not
needed in public headers so place the prototype to net_private.h file.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Do the selection same way as in IPv6 so that if user supplies
unspecified destination address, the default interface is selected
the same way.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Some of the network tests require that source and destination
addresses are not swapped so allow test to control the address
swapping from the test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Remove unnecessary include in header and source file.
gmtime_r() is an extension to the C library, and therefore one
needs to explicitly ask for its prototype to have it exposed.
This is done by defining _POSIX_C_SOURCE so let's do so.
These two changes fix build errors with some libCs.
Tested with pico, newlib, minimal and the host glibc.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This patch defines the message format for AVCTP unit message.
This is the first out of the four types of commands and can be
used by the CT to obtain the unit info from the TG device.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Only the basic functions for establishing an AVCTP connection
are provided at this stage.
An BR/EDR ACL connection is necessary before AVRCP function.
Register callbacks before utilizing AVRCP.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch add SDP records for both CT and TG role.
The SDP attribute would be registered according to the configuration.
OBEX and Browsing commands are optional and yet not supported.
SDP registration is implemented at AVRCP level to simplify the
workload of the upper layer. We assume the App can have limited
knowledge on SDP structures.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch implementing avrcp.c
New Kconfig BT_AVRCP is provided to enable this layer.
BT_AVRCP_TARGET and BT_AVRCP_CONTROLLER are then
provided to enable one of the two roles independently.
avrcp.h shows the APIs for the upper layer.
Only connection and disconnection interfaces are provided in this patch.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This patch implementing avctp.c
New Kconfig BT_AVCTP is provided to enable this layer.
avctp_internal.h shows the APIs for the upper layer, i.e., AVRCP.
Only connection and disconnection interfaces are provided in this patch.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
This adds a new kconfig for eviction algorithm which needs page
tracking. When enabled, k_mem_paging_eviction_add()/_remove()
and k_mem_paging_eviction_accessed() must be implemented.
If an algorithm does not do page tracking, there is no need to
implement these functions, and no need for the kernel MMU code
to call into empty functions. This should save a few function
calls and some CPU cycles.
Note that arm64 unconditionally calls those functions so
forces CONFIG_EVICTION_TRACKING to be enabled there.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This fixes#78721 which was introduced in PR #44686, which changed (and
renamed) `adv_new_legacy`/`adv_get_legacy` to return an existing
`bt_dev.adv` if it existed. This caused a problem, where the existing
adv then would be used to start advertising, and if this fails (because
the adv is already advertising, for instance), `bt_le_adv_start` would
erroneously delete the adv, making the host lose the context for the adv
which still is advertising.
Before PR #44686, this would not happen, because `bt_le_adv_start` would
return early when `adv_new_legacy` returned `NULL` and never reach the
delete call.
I have refactored this to make responsibilities a bit more clear:
`adv_create_legacy` now does 1 thing: create an ext adv and assign as
the legacy advertiser. This mirrors `bt_le_adv_delete_legacy` which does
the opposite. I have implemented error codes to match the behavior that
PR #44686 was made to implement.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
After we take the true MTU into account, we need to send proper
number of bytes (multiple of 8) in one IPv6 fragment.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>