Use the newly added API to get specific type of stats (if supported) but
also keep the backwards compatibility.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Add a new API that takes stat type, the networking stack only needs
NATIVE stats per-packet, it doesn't need to update vendor stats
per-packet. This saves unncessary exchanges in case driver needs to
query the firmware for the vendor stats.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
According to the docs the millis were in the format `.SSSSSS`. In
reality though, it only accepted exactly `.SSS`, not `.SS` or `.SSSS`
and specifically also not `.SSSSSS`, contrary to the docs. Further, it did
not fail with an error message but simply produced the wrong value.
With this change it accepts everything from `.` to `.SSSSSS` and
produces the correct result. This is compatible with the previous
behavior, with the documentation and with everything in between.
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
In d45cd6716b the mayority of the Zephyr
networking code was changed to use the Zephyr native net_/zsock_
prefixed types, but some symbols were forgotten.
Let's change them.
Without these fixes/changes the code still builds in most cases as we are
by now setting CONFIG_NET_NAMESPACE_COMPAT_MODE.
But when this is not set, things will fail to build.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
802.15.4 specifies that a device may send a DATA_REQUEST command to the
coordinator after waiting for "macResponseWaitTime", starting after the
acknowledgment to the association request command.
This change adds support to generate DATA_REQUEST frames and sends one
for the association usecase only. The two other usecases, for MLME-POLL
or for beacon-enabled PAN, are not yet supported.
Signed-off-by: Simon Piriou <spiriou31@gmail.com>
WS_MAGIC is a constant string and when calculating lengths for copying
we always exclude the NULL terminator. In result, using strncpy() for
copying can generate a warning about truncated string, as WS_MAGIC will
always be truncated from the NULL terminator. Therefore replace
strncpy() with memcpy() as it seems more appropriate for this case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit aims to make use of sin6_scope_id field of net_sockaddr_in6
structure to correctly choose the network interface when destination
address in link-local.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
Replaces direct byte shifting and assignment with `sys_put_le16`,
`sys_put_le32`, and `sys_put_le64` to simplify the `memory_dump` function.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
To improve code clarity, use `shell_print` in place of `shell_fprintf`
with `SHELL_NORMAL` where appropriate.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
We're now checking if there is space prior to executing the loop body,
therefore guaranteeing this condition is never going to fire in a
single-threaded context.
Signed-off-by: Stuart Longland <stuartl@vrt.com.au>
Before calling `uart_poll_in`, check we have space to store the character
in the ring buffer beforehand. If we do, *then* poll for the character.
That way we don't miss out on serial traffic when our ring buffer is full
unless we fill our hardware ring buffer too.
Signed-off-by: Stuart Longland <stuartl@vrt.com.au>
The qsort() function takes a callback argument that is having the
same semantics as strcmp(). Fix uvc_compare_frmival_desc() sorting
to make qsort() list frame intervals in increasing values.
Fix a bug where Windows would not enumerate devices when the video device
have multiple frame interval supported.
Signed-off-by: Josuah Demangeon <me@josuah.net>
In option of HCI_LE_Periodic_Advertising_Create_Sync, bit 2
depend on Periodic Advertising ADI Support feature.
Signed-off-by: Gang He <ganghe@sifli.com>
Fix SonarQube warnings, move variable declarations to the
top of the block according to Zephyr code style
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Protected Storage is another type of secure (encrypted and
authenticated) storage available using PSA interfaces.
When targeting TF-M builds, allow making use of PS for storing settings
Fixes#94681
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Prepare for extending this backend to also allow storing settings in the
PS (Protected Storage).
Mostly file and kconfig renames, as well as updates
to comments and log messages.
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Add tracing support for timer expiry and stop function callbacks,
enabling measurement of callback execution duration and facilitating
debugging of cases where callbacks take longer than expected.
Signed-off-by: Vijay Sharma <vijshar@qti.qualcomm.com>
According to DSP0283 1.0.1, Length byte in MCTP over USB header
fields should start from the "MCTP over USB Header" to the last
byte in the "MCTP packet payload"
Signed-off-by: John Chung <john.chung@arm.com>
Changes the type used in _system_heap extern declarations to use
k_heap instead of sys_heap.
Fixes#100530
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
We are hitting the limit of 256 events possible with event id right now
defined as uint8_t.
The bandwidth increase is minimal (2 bytes per event) compared to the
payload data, and the scalability benefits far outweigh the costs.
Existing CTF traces with 8-bit IDs won't be compatible.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Introduce the optional OMA 10523/10524 send scheduler extension to manage
cached resources, including control and sampling rule objects, cache
filter with gt/lt/st and pmin/pmax handling, max-age/max-sample limits,
and registration flush helper.
Add an overlay to the LWM2M client sample.
Add a fake humidity sensor.
Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
A invalid indicator index will cause the underflow of the array
`ag_ind` if the indicator index is not returned by AG in the
response of AT command `AT+CIND=?`.
Replace hardcoded `-1` values with HFP_HF_INDICATOR_INVALID constant
for better code readability and maintainability. Add proper bounds
checking to validate indicator indices before accessing the `ag_ind`
array using the `ind_table` mapping.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
There is an issue found that the sco conn cannot be released when the
SCO has been disconnected. The sco conn count is referred in the sco
connected callback due to the `sco_conn` is NULL while `sco_conn`
should not be NULL when the sco connected callback is triggered.
It is a race condition issue where the sco connected callback is
triggered before `sco_conn` is updated. The sco conn reference count
has been referred incorrectly, actually it should not be referred.
Replace direct pointer access to `sco_conn` with atomic operations to
prevent race conditions in concurrent SCO connection scenarios.
If the value of `sco_conn` is not NULL when trying to set the return
value of `bt_conn_create_sco()` to `sco_conn`, it means the race
condition occurs. In this situation, discount the sco conn reference
count to fix the issue.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
- Currently, it is not possible to use mcumgr client with smp server
since there is no way to specify smp server address for requests.
- This patch series adds support for creating smp_client_object
containing information regarding the host server. This design allows
multiple smp_client_object to exist for the same underlying smp_udp
transport, making it much easier to use the same udp socket for multiple
OTAs.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Allow passing some context to the shell bypass callback function by
providing a void pointer user data argument.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
When MOPL exceeds MTU, adjust it to match MTU instead of failing the
connection. This handles the common case where mainstream mobile
operating systems (iPhone and Android) negotiate
MOPL values greater than the RFCOMM or L2CAP MTU.
Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
A race condition was observed with concurrent net_context_get()
and net_context_unref() calls: If net_context_unref() is interrupted
just after clearing the NET_CONTEXT_IN_USE flag, net_context_get() may
try to reuse the context and reinitialize its mutex through
k_mutex_init(). Once net_context_unref() resumes, it calls
k_mutex_unlock() on the newly initialized mutex, which may lead to the
following assertion:
ASSERTION FAIL [mutex->lock_count > 0U] @ zephyr/kernel/mutex.c
Fix this by unlocking the context mutex before clearing the
NET_CONTEXT_IN_USE flag.
Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
The variable 'unspec_addr' in net_dhcpv6_init() is implicitly
initialized on some platforms and optimization levels, but not
guaranteed to be initialized on all code paths when built with
compiler instrumentation.
This leads to a build failure with the strict
'-Werror=maybe-uninitialized' warning when code coverage flags are
enabled (e.g., via twister --coverage).
```
zephyr/subsys/net/lib/dhcpv6/dhcpv6.c:2325:26: error: ‘unspec_addr’
may be used uninitialized [-Werror=maybe-uninitialized]
net_ipaddr_copy(&net_sin6(&unspec_addr)->sin6_addr,
```
Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
The broadcast_state variable was not used in
bt_bap_broadcast_source_update_metadata to verify the
state, but broadcast_source_get_state was instead called
twice.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor the bt_bap_broadcast_source_reconfig function to be less
complex by splitting the verification into multiple functions.
Additionally, it also fixes a rare, but potential, issue where
some subgroups were updated before a later subgroup would fail
to be updated. Added can_merge_codec_cfg_data to verify correctness
before we attempt to update any subgroups. This new check is also
applied to bt_bap_broadcast_source_create.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the subgroup parameter validation to its own function to
reduce the size and complexity of valid_broadcast_source_param
to make Sonarcube happy.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
move sbc to bluetooth because only bluetooth uses it,
change CONFIG_LIBSBC_ENCODER and CONFIG_LIBSBC_DECODER as CONFIG_LIBSBC.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
When working on CMUX power saving, it is typical
that we end up closing the pipe before the last
RX_READY event is handled from workqueue, so we end up
receiving -EPERM which is not really a fatal error.
Pipes recover when they are re-opened. So drop this error
and return zero instead, like modem_pipe_open() and close() does.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Instead of copying all fields from cmux_config into run-time
struct cmux, just have the configuration structure as a member.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
CMUX driver can enable the support for idle-timer in
devicetree and can be requested to shut down the pipe
during sleep.
Then UART backend put the actual device into sleep when
pipe is closed.
Waking up is requested by sending data to DLC pipe
or by manually opening the uart_pipe.
Modem may request similar wake-up by a RING interrupt which
would open the same pipe.
When UART is powered and pipe is not closed, CMUX wake-up
procedure is automatic. Either end may initiate the wake-up.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Signal powersaving mode for the remote end using PSC command.
Wakes up the remote end from powersaving mode by sending flag characters.
This method is defined in 3GPP TS 27.010.
Sections 5.4.6.3.2 Power Saving Control (PSC) and
5.4.7 Power Control and Wake-up Mechanisms.
Essentially it is one PSC command to indicate a sleep state, and
then repeated flag characters to wake up the remote end or indicate
that we have been woken up.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>