Writable string entries in ocpp_cfg_info are free'd if non NULL in
ocpp_set_cfg_val(). Thus they should not be statically allocated.
Initialise with NULL instead.
CFG_SUPPORTED_FEATURE_PROFILE is not writable and should be fine.
Signed-off-by: Markus Becker <markushx@gmail.com>
BootNotification did not transport Serial Number and other information,
because the NULL check is wrong.
Signed-off-by: Markus Becker <markushx@gmail.com>
use zephyr ring buffer and also read and write more
than one char at a time.
Also use events to notify new rx or tx.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
CONFIG_CONSOLE_GETCHAR doesn't need
`CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS`
and `CONFIG_CONSOLE_HANDLER` since a long time.
So don't select it unnessesaryly.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
A struct net_sockaddr should be considered an incomplete type, replace by
using net_sockaddr_storage.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
If `attr` or `attr->user_data` is NULL, then the include
characteristic is invalid. However the function,
bt_gatt_attr_read_included, should not return an errno value, but
a GATT error. The reason why errno cannot be used, is that the
return value is parsed through err_to_att which would make
-EINVAL become 0x16 (depending on the libc implementation),
which is an invalid ATT error code.
This was incorrectly introduced by commit
5a8189bf2a.
Changed the return value from errno to a proper GATT/ATT error.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When providing a addr in net_if_set_link_addr() it should be
constant, as this function should not change the address
in the pointer.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Update the HW models module to:
63ccab2988bf4c144b3cd324a0277e03206fa413
Including the following:
63ccab2 RADIO: Adjust Tx rampup timings
72d7680 RADIO: Correct note
AND
Adjust Bluetooth controller radio hal timings to match this new timings.
AND
Change the random seed in a very long test which is relatively sensitive
to timing, and fails due to this rampup timing change.
Repeat of note from 63ccab2:
--
IMPORTANT!: This commit changes the timing of the radio model, and
therefore requires controller SW to adjust its constants accordingly.
Even after such an adjustment it is likely some tests timing will change
marginally (if for example some advertisement event anchoring is done
as soon as possible by the controller or the like), and therefore that
some tests execution will change, and that too time sensitive test may
fail.
--
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Increase the maximum allowed repeat count for read and write/erase
test commands from 10 to 10000. This allows for more accurate
measurements over longer test durations.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Add a way to add private key, peer endpoint and keepalive
when setting up the wireguard connection using the shell.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make blake2s private so that it cannot be used (easily) by other parts
of Zephyr codespace. The blake2s is part of the code until PSA will
have support for it. At that point the code will be removed and
replaced by the PSA calls.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of using buffers for keys, use PSA key management to
store the keys. This is more safe than handling buffers in
the code directly.
Do some cleanup of the code structure and make the functions
in wg_psa.c static to disallow use outside of Wireguard.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If running wg in native-sim, use the host clock to get the
current time. This helps to have a proper handshake when
connecting even after restarting the zephyr.exe process.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to provide a function that will need to get
the current time from a RTC or SNTP or similar.
Wireguard handshake replay prevention needs a monotonic
time so the application should get it from somewhere.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Send peer add/del network event when the peers is either added
to the system or deleted from the system.
Send VPN connected / disconnected event when a VPN connection
is successfully established or the peer connection is disconnected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The "net wg show 1" will show detailed information of the peer
id 1. This is useful when debugging connectivity issues.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The crypto code is taken from wireguard-lwip project at
https://github.com/smartalock/wireguard-lwip
and is BSD-3-Clause licensed code.
The Blake2 RFC 7693 and XChaCha20 (from
https://datatracker.ietf.org/doc/html/draft-arciszewski-xchacha-03)
cannot currently use PSA APIs.
The XChaCha20 is found in PSA 1.2 but Zephyr is not yet using that
version.
All the other crypto usage is converted to use PSA APIs.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
As described in https://www.wireguard.com/protocol/
set DSCP to AF41 for handshake messages. The transport data
DSCP is set to 0.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The supported contexts were read but never provided to the
upper layers. Additionally if the supported contexts are
notifible we also subscribe to it.
This commit also fixed some other various things related
to the change to supported contexts.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The option needs a dependency to THREAD_MONITOR, fix a build breakage
with, for example:
west build -p -b nrf52dk/nrf52832 samples/subsys/shell/shell_module -- \
-DCONFIG_EXTRA_EXCEPTION_INFO=y -DCONFIG_THREAD_MONITOR=n
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
With 6GHz band, channel numbers are not unique anymore, channel 1 can
mean both 2.4GHz or 6GHz, so, take the band info as the argument from
the user.
Keep auto-detection for backwards compatibility sake.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
Use a different API call to complete the function rather than
relying on USB .init() to terminate the configuration.
This allows to set the endpoint descriptors before usbd_init()
is called.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Add support for the LOG_OUTPUT_FLAG_THREAD flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_THREAD_ID_PREFIX is
enabled, this allows log messages to display the thread name or ID as a
prefix.
This enables displaying information about running threads and their
priorities, which can be useful debug information for analyzing system
behavior and thread execution patterns.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add support for the LOG_OUTPUT_FLAG_CORE flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_CORE_ID_PREFIX is
enabled, this allows log messages to display the originating CPU core ID
as a prefix.
This is particularly useful in multicore ADSP systems where deferred
logging may format messages on a different core than where they were
created. The core ID prefix helps identify which core generated each log
message.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add support for displaying the CPU core ID that generated each log
message. This is particularly useful for debugging multicore embedded
systems where identifying the originating core is critical.
Key implementation details:
- Add CONFIG_LOG_CORE_ID_PREFIX Kconfig option (depends on SMP or
MP_MAX_NUM_CPUS > 1)
- Capture arch_proc_id() at log message creation time to ensure the
correct core ID is recorded, even when log processing happens on a
different core
- Add core_id field to log_msg_hdr structure
- Add LOG_OUTPUT_FLAG_CORE flag (BIT 9)
- Display format: "[core %d]" prefix in log output
- Add log_msg_get_core_id() accessor function
The core ID is captured when the log message is created (not when
formatted), which is essential for deferred logging where the processing
thread may run on a different core than the one that generated the log.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Take into account the maximum frequency indicated in host capabilities
when changing the bus frequency, to avoid failing calls to sdhc_set_io()
when an MMC device is capable of working with higher frequencies than
the host can handle.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
If we get a remote request to originate a call via a control
point write, we lookup a TBS instance based on the URI.
However for the local API function bt_tbs_originate we did
not, so the same operation, if the target bearer was GTBS,
had different behavior depending on whether it was locally or
remotely invoked.
This commit makes the two behave the same.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This allows to tune L2CAP RTX timer value for L2CAP connection
requests. Allowed range is 1-60 seconds while defaults to 40.
Since this is mainly useful for BI (behavior invalid) qualification
tests allows to tune it only if BT_TESTING is selected.
This is required for running L2CAP/COS/CED/BI-29-C qualification
test in reasonable time since it requires 255 iterations of
failed (timed out) connection requests.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add missing notification clearing for the GTBS instance
in the disconnected callback.
Fixes#104568
Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
If the client removes its subscription to any of the TBS
characteristics at any time, the pending appropriate flags
are now being cleared.
Fixeszephyrproject-rtos/zephyr#104511
Signed-off-by: Hanliang Xu <leonxu2004@outlook.com>
This removes dead code. Since bt_bap_stream_detach sets
stream->ep = NULL then the call to bt_bap_stream_iso_chan_get
will always return NULL since stream->ep is NULL, and thus
the call to bt_bap_stream_disconnect would always be a no-op.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Modify foreach functions in LE Audio to follow the same pattern:
Return true to continue iterating.
Return false to stop iterating.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for the IPSO Magnetometer object version 1.0 (Object ID
3314) which allows an LwM2M server to read magnetic field values from
a 1-3 axis magnetometer.
The object is enabled in tests/net/all/prj.conf to ensure it is
built as part of the CI all-in networking build.
Signed-off-by: Savo Saicic <savo.saicic@gmail.com>
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Use a code spell-checking tool to detect and fix spelling errors in
the files under `subsys/bluetooth`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
The OpenRISC 1000 architecture can be tested through the qemu_or1k emulated
SoC and board. Because this emulated device has minimal external hardware
by default, this patch enables a minimal suite of tests covering core
kernel features for the CPU architecture.
When running the test suite, OpenRISC was found to require additional stack
space to prevent an overflow. Therefore, a minimal additional amount of
storage: 128-bytes, was added that was found in practice to allow tests to
complete.
Note that Qemu version 9.2.0 or newer is required so as to include the
following commit:
commit 3eb43aeb164f1f83c97ff693c7d464b49755110c
Author: Joel Holdsworth <jholdsworth@nvidia.com>
Date: Fri Jun 7 15:29:33 2024 -0700
hw/openrisc: Fixed undercounting of TTCR in continuous mode
This fixes a bug in the implementation of the emulated OpenRISC Tick Timer
which prevents the Zephyr OpenRISC port from task-scheduling properly.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>