A warning is giving for missing initalizer for field `exit_latency_us`
of `struct pm_state_info`. This adds the additional init fields.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Make sure smp_transport_clients list is only initialized once and
before any transports will try to register and add entries to this
list.
The smp_init() routine was called after smp_init_uart(), causing
the list to be emptied again after registration of the uart client
transport.
Signed-off-by: Bas van Loon <bas@arch-embedded.com>
Replaces code that peeked directly into the thread by instead
calling k_thread_join() to check the state of threads
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
k_fifo_put is a macro that expands the call to net_pkt_ref(pending)
multiple times when CONFIG_TRACING is enabled thus causing extra
reference for the pending packet and a memory leak.
Fix by moving the referencing call to a separate line.
Signed-off-by: Rait Rääk <raitraak@gmail.com>
The functions `le_sc_oob_config_set`, `generate_dhkey` and
`display_passkey` in `smp.c` were only defined when
`CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY` was not defined. This created
issues at build time.
Remove the guard as the code calling those functions is not guarded
itself.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Fix possible race condition where SMP client might
release the network buffer before system worker queue
has processed it.
In smp_client uses shared resources like worker queue
linked list and network buffers without maintaining any
thread safety.
For unknown reasons, retry timeout handling is pushed
into system worker queue while the actual transmission
is handled from SMP work queue.
Fix the issue by using the same SMP work queue
for both delayable timeout handling as well as
transmission handling.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
In case TLS connect timed out during the handshake, errno was set to
EAGAIN which is unexpected and confusing. Fix this and set the errno
to ETIMEDOUT instead.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast sink, such as the BIG synced and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add callbacks that is called for the entire BIG.
The BIG state is from an HCI perspective a single state change
that we previously only propagated as a state change for each
channel.
However it may be simpler for applications and higher layers
to use BIG changes to trigger their behavior.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This fixes an issue that occurred if deferred_work is queued by another
procedure before we run bt_conn_set_state(BT_CONN_DISCONNECTED).
bt_conn_set_state yields to the system work queue in bt_conn_tx_notify,
and then deferred_work runs and handles the disconnected callbacks.
bt_conn_set_state then enqueues another deferred_work which calls the
disconnected callbacks again and causes an assert. k_work_cancel_delayable
will clear queued deferred work when we call
bt_conn_set_state(BT_CONN_DISCONNECTED), guaranteeing that the disconnect
callbacks will only be called once.
Signed-off-by: Timothy Keys <timothy.keys@nordicsemi.no>
Since the function `bt_sdp_discover` has been updated, the caller of
function needs to be updated to avoid the building and functionality
fault.
Add set the parameter `type` to value
`BT_SDP_DISCOVER_SERVICE_SEARCH_ATTR`.
Update the SDP discovery callback function. Make it align with
`bt_sdp_discover_func_t`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Extend the function `bt_sdp_discover` to support service search
transaction and service attribute transaction.
Improve the `session->rec_buf`. If the net buffer cannot be allocated
from the channel, disconnect the SDP session.
Set the `MaximumAttributeByteCount` of the request
`SDP_SERVICE_SEARCH_ATTR_REQ` with the tail room of `session->rec_buf`.
Set the `MaximumAttributeByteCount` of the request `SDP_SERVICE_ATTR_REQ`
with the tail room of `session->rec_buf`.
Set the `MaximumServiceRecordCount` of the request
`SDP_SERVICE_SEARCH_REQ` according to the tail room of
`session->rec_buf`.
Handle the response code `SDP_SERVICE_SEARCH_RSP`, and
`SDP_SERVICE_ATTR_RSP`.
Handle the error `SDP_ERROR_RSP`. Start the next SDP discovery if the
error received.
If there no more request, disconnect the session.
If the request cannot be sent, start the next SDP discovery.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
For WiFi interface, uniformly use net_if_get_wifi_sta() and
net_if_get_wifi_sap() APIs to replace net_if_get_first_wifi().
Signed-off-by: Gang Li <gang.li_1@nxp.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `host/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
The shell-less functions `bt_do_scan_filter_clear_name`, `bt_do_scan_off`,
and `bt_do_connect_le` were added so they can be called without `sh`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Limit the usage of `ctx_shell` to cases where printing requires it
and `sh` is not available.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Introduced `bt_shell_private.c` and `bt_shell_private.h` to provide
common functions for the Bluetooth `shell_wall_print`.
These functions are equivalent to `shell_fprintf`, `shell_info`,
`shell_print`, `shell_warn`, `shell_error` and `shell_hexdump`
but without requiring the `sh` parameter.
The cost of the newly added `bt_shell_fprintf_info` ... `_error` functions
will be negligible when there are many individual calls that need to pass
both the `sh` and `color` parameters each time.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Fix reschedule for ticker that yield such that reduce the
slot window after intersection to include required
ticks_slot, and we do not take the interval of the
colliding ticker provided every expiry increments the
interval by random amount of ticks. This is the case for
primary channel advertising.
Fixes commit e1cd5ba77f59 ("Bluetooth: Controller: Fix to
reschedule after overlap when yielding").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Concurrent HTTP POST requests on different HTTP2 concurrent streams
require that the client's header_capture_context is re-used to capture
headers on a second stream before all of the body data has been received
(and sent to the application) on the first stream.
As a result, any captured headers must be sent to the application
callback before any headers can be received on a different stream. In
practice this means that for HTTP2 the application callback is called
for the first time on receiving a headers frame, before any data frames
are received. All subsequent application callbacks will not include the
request header data.
While this mechanism is not necessary for HTTP1, it is also updated to
only send headers in the first application callback for consistency.
Fixes#82273
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
To correctly handle concurrent HTTP POST requests via different http2
streams on the same client context, it is necessary to store the
resource detail at an HTTP2 stream level rather than at an HTTP client
level, otherwise only one resource detail can be stored.
Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
Implement a sample app to perform basic GPIO tracing.
Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
If GPIO tracing is enabled, then the system will track
various GPIO pin events.
Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
Some backends use DMA. Usually, DMA doesn't work correctly, when memory
to transfer is cached. Add a config to place the common buffers in the
nocache section.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Disable and enable SPI module before every transaction for STM32H7
chips. It is a recommended way in the STM32 RM. In another case, a first
byte of a transaction is always 0x00.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
STM32H7 chips have additional configuration regarding underrun event.
Configure the underrun behaviour correctly to use the underrun pattern
and clear the underrun bit before sending new data.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Move enabling CS interrupt at the end of the backend configuration,
when everything is ready.
It prevents handling the interrupt, when something is not prepared e.g.
DMA is not configured.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Fix support for clock domains. Create define that identify if
clock domain was selected in any of the st_stm32_spi_host_cmd nodes.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Default the Minimum encryption key size to 16.
Key with reduced size is easier to brut force.
Disable LE legacy pairing by default since it's not secure.
These defaults should suite majority of newly developed applications.
It's better to use sensible more secure defaults,
so applications that really need less secure option consciously change it,
not the other way around.
This may help to prevent downgrade attacks.
Signed-off-by: Sergey Korotkov <sergey.korotkov@nordicsemi.no>
The deprecated CONFIG_NET_SOCKETS_POSIX_NAMES option is removed.
If one wishes to use POSIX API socket calls, then CONFIG_POSIX_API
option needs to be enabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Log the create BIG params for debugging purposes.
Also slightly modifies the `qos` struct to use a more
suitable struct to avoid always doing `qos->tx->` and
can now just be `qos->`.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Referring to MshDFU_v1.0 Sections 6.1.1, 6.2.1 and 7.1.1 model
descriptions: DFU/DFD server/clients extend BLOB Transfer root models
and DFD server requires Firmware Update Client on the same element. For
this reason we need to make sure that those main models or root models
exist on the same element. And also firmware update client can not be
forced to be in the first element.
For all model extention call return the error code in case of an error.
Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
It is recommended to record the subunit type itself instead of the
subunit ID when validating the transaction. This approach is more
meaningful and less prone to misinterpretation.
Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Deprecate BT_CTLR, and add a new HAS_BT_CTLR as a virtual option which
specific users (like BT_LL_SW_SPLIT) select. This also means that we can
remove all places that were forcefully enabling the BT_CTLR option, and
instead we now depend on devicetree to get some local LL HCI driver
enabled which in turn also enables the HAS_BT_CTLR option.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Removed implying of NVS by the NET_L2_OPENTHREAD, and from now a
platform can choose between ZMS and NVS as a settings backend.
NET_L2_OPENTHREAD still requires NVS or ZMS backend so the config
depends on one of those.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
lwm2m_engine_set() and lwm2m_engine_get() locks
the registry_lock mutex, but this is not unlocked
when setting or getting a time resource where the buffer
lengths are invalid resulting in an early return without
unlocking the mutex. This results in a deadlock when
attempting to lock the registry in another thread.
Signed-off-by: Steven Poon <steven-github@outlook.com>
The commit adds flash_area_sectors function that allows to get information
on sector/erase page layout by flash_area object pointer instead of
index.
The only difference between flash_area_sectors and flash_area_get_sectors
is that the later calls flash_area_open internally and as such requires
flash map to be compiled in.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>