Relocated `bt_shell_private.c` to the `common` folder to enable
independent use between `BT_SHELL` and `BT_MESH_SHELL`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Pass the report buffer originally provided in hid_device_submit_report()
as a parameter to input_report_done() callback. Example use case is to
enable HID report multi buffering which is easiest achieved by
allocating report buffer before submitting it and then releasing the
buffer after it has been sent.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
By using `SETTINGS_STATIC_HANDLER_DEFINE_WITH_CPRIO` we can ensure that
BT subsystems always get loaded after BT, and BT Mesh after both of
them.
This solves the host having to register a GATT service in a delayed
manner, as we are sure to now register the GATT service after sc_commit
sets `SC_LOAD`.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
uuid needs to be keept in pb_gatt_cli server context until the client
is connected to server, otherwise, since we only kept the pointer from
the net_buffer, any incoming unprovisioned beacon before the connection
is established may overwrite uuid.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
The net_pkt_clone() did not cloned all needed fields.
Added what was missing from the clone.
Fixes#83157
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When serving a static file to the HTTP client, we need to supply also
content length field so that the connection can be closed immediately
when the file is fully sent.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
In case websocket logger is disabled, the websocket shell backend should
still build, fix that.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case websocket logging is enabled, the websocket shell should not be
configured as a logger backend, otherwise logs are duplicated.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The debug printing feature seems to be broken by design - not only in a
default configuration it would trigger endless logging loop (as printk
is piped through logging subsys), it also doesn't work well with
deferred logging (additional artifacts in the output).
Since similar effect can be achieved by enabling any other logger
backend, which should receive the same data as the websocket one, simply
remove it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case the log message length exceeded the websocket buffer size, the
backend would drop the overflowing character, instead of sending it as a
part of the next message.
Rework the ws_console_out() logic a bit to prevent that.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The log output function registered for the logger backend is expected to
return the number of bytes processed, but currently it returns the TX
retry count. This commit fixes it. In case data could only partially be
sent, respective bytes count is returned. In case of TX error, the bytes
are assumed dropped to prevent busy looping in the logger.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Wrong symbol was used for log level when registering logger instance for
websocket shell, causing misconfiguration and in result unexpected
crashes.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If the CoAP server receives a message that doesn't fit into the receive
buffer, we should stop processing the message and respond to the client
with 4.13 "Request Entity too large".
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
* The `bt_dev.le.conn_ready` list is accessed by the tx_processor
which runs in a workqueue, but `bt_conn_data_ready` can be called
from different threads so we need to make sure that nothing will
trigger a context switch while we are manipulating the list since
sys_slist_*() functions are not thread safe.
* This only happens if call to `bt_conn_data_ready` is performed
from a preemptive task which can happen depending on the
application.
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
Allowed toolchains was not set in 'board' metadata causing those to not
build and get filtered.
Fixes#83792
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This macro is defined in a few places which leads to macro redefinition
error e.g. when compiling prometheus network sample for NPCX boards.
Provide one definition of IS_BIT_SET() in util_macro.h to fix the
problem.
Signed-off-by: Patryk Duda <patrykd@google.com>
Check whether the length of buf is consistent with the valid data
received for op code BT_BAP_BASS_OP_ADD_SRC and BT_BAP_BASS_OP_MOD_SRC.
If the length of buf is inconsistent with the valid data received, the
response is error code BT_ATT_ERR_WRITE_REQ_REJECTED instead of other
errors.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").
This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.
The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.
Hence this revert.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add check that should enable MFP when connect to WPA3 network,
as MFP required is mandatory for WPA3 network.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Support printing WPA3 enterprise type in scan result for more
accurate display, including the suiteb, suiteb-192 and WPA3
enterprise only.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
For 'wifi status' and 'wifi ap status' cmd of the hostap case,
originally only support getting 'EAP-TLS' for the enterprise
mode, which is not correct. Now support getting the specific
enterprise mode, including the WPA3 enterprise mode and
the EAP method type.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Change Wi-Fi suiteb type into WPA3 enterprise security type, it
includes suiteB, suiteB-192 and WPA3 enterprise only mode.
Support setting WPA3 enterprise only mode, which should use
cipher_config->key_mgmt as WPA-EAP-SHA256, and the AKM in RSN
IE will show 00-0F-AC:5.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Remove EAP TLS SHA256 security, as it was added to support the AKM
of 00-0F-AC:5 in RSN IE, but actually this AKM is used by WPA3
enterprise only mode.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
The check combination of "is zero" and then "less than zero" leaves open
the theoretical possibility of a positive return value, which would
continue on with an uinitialized 'sym'.
Checking for "not zero" has the same effect and covers all situations.
Commit 56fd85442 did the same thing for 'rela' a few lines above, but
missed this instance. No other places in the llext code have this issue.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Previously, filesystems could not be mounted at '/' because
mount points were restricted to being at least 2 characters.
Since '/' corresponds to the standard POSIX root filesystem
location, reduce the minimum length of a mount point to
1 character.
With that, we can mount a POSIX root filesystem.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
In order to be functional and avoid linker errors, use a
default setting for BACKING_STORE_CHOICE that is something other
than "this is not implemented".
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Both the TMAP kconfig file and public header file defined
which roles were supported.
The Kconfig file options were recently added and were more
up to date (and correct), and allows for other Kconfig files
to use these values, thus allowing for more flexibility when
implementing applications.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Ensure that HTTP resources can only be served to a client connected on
the specific service(s) that the resource was registered against using
the HTTP_RESOURCE_DEFINE macro.
This allows different resources to be registered to different services,
for example to make some resources only available via an HTTPS service
and not via unencrypted HTTP.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
add CONFIG_HAWKBIT_SAVE_PROGRESS_INTERVAL, to
be able to set a interval, how often the progress is saved.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The lookahead buffer is a bitmap containing info on free blocks and does
not have a minimum size or an alignment requirement.
This fixes the arbitrary 4 * block_size requirement for block devices
and fixes Kconfig documentation to remove a reference to nonexistent
8 byte alignment requirement.
Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
Instead of picking a set of safe block multiple sized values for caches,
round down to the nearest block multiple, increasing static buffer usage
determined by Kconfig variables.
Signed-off-by: Djordje Nedic <nedic.djordje2@gmail.com>
With assert condition set to true, assertion never happens.
Change __ASSERT(true) to __ASSERT(false).
Signed-off-by: Dmitry Lukyantsev <dmitrylu@meta.com>
Passing HTTP upgrade request context to the user callback allows the
user to decide whether to accept or reject the websocket connection
based on the HTTP headers in the request. The primary reason for this is
to enable authentication of the websocket connection (e.g. via cookies
or Authorization header).
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
The CCP API for the Call Control Profile works on top of the
TBS API, and will eventually replace parts of the TBS API.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If a time-intensive task (like coredump storage over logging interface)
is run in the task watchdog callback, the hardware watchdog might
reset the system before the task finishes.
Increasing the delay from 1s to 10s, which should be sufficient for any
use case.
Signed-off-by: Martin Jäger <martin@libre.solar>
The commit changes requirements for stream_flash_init, where size
can no longer be 0 and has to be explicitly set, to avoid situation
where size autodetection, invoked by size == 0, would miss changes in
layout and silently allow overflow of Stream Flash into other partitions.
There has also been new Kconfig option CONFIG_STREAM_FLASH_INSPECT,
set to y by default to keep legacy behaviour, that can be used to turn
off stream_flash_ctx vs device inspection, allowing user to shed
inspection code once it is not useful anymore.
Fixes: #71042
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit moves Settigns initialization out of stream_flash
initialization function into: stream_flash_progress_clear
stream_flash_progress_load and stream_flash_progress_save.
This slightly increases code size (~56 bytes on Arm) but allows
to initialize Stream Flash even if Settings subsystem fails
to initialize and continue providing its basic functionality.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
If logging (CONFIG_LOGGING) was disabled, then the shell
could not build. Ideally the (test) functions should not
depend on logging, but rather only CONFIG_BT_TESTING.
The shell commands were also properly guarded.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
RFC6455 section 5.1 specifies that "A server MUST NOT mask any frames
that it sends to the client". Implement this for websocket write calls
via ZVFS, by storing in the websocket_context whether a socket is acting
in the client or server role, and using this to determine if sent data
should be masked.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Adds a new error code that can be used to signify that a query was
valid but the response was not valid
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The DHCPv4 options always assigns the DNS address if the router
provides one through the DHCP callback. There are times a developer
may not always want to assign the server from the router, but only
manually assign them. Adding a Kconfig option for assigning the DNS
address and defaulting to true to not interfere with previously
expected functionality.
Signed-off-by: Kris Wolff <kwolff@wavelynx.com>
Latest supplicant uses 1K buffer size for sending control message via
socketpair, so reducing the NET_SOCKETPAIR_BUFFER_SIZE to save memory
footprint. There are 4 socketpairs for supplicant only case, and 6
socketpairs for hostapd case, update the heap size correspondingly.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>