If a gateway is not set for a interface,
also log the destination address.
Also print the interface index instead of the
interface pointer.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
When CONFIG_LLEXT_STORAGE_WRITABLE is selected and .pre_located is
set, the BSS section is allocated by the user too, no need to
allocate it internally.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Switch from using direct `strtol` calls to `shell_strtol`.
This change leverages the extensive error handling provided
by `shell_strtol`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Since the `fb` pointer is always assigned to `char_fb`, there is no need
for a `NULL` check. Additionally, removed setting `fb->buf` to `NULL` in
`cfb_framebuffer_init` as it will be overwritten by subsequent operations.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Added `len` to store the result of `strlen(str)` to avoid
multiple calls to `strlen` in the `for-loop`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add conversion macros from milliseconds to various units.
The purpose of these macros is to make it more clear/easier
for users to set and read values using milliseconds rather
than the various BT units which may be in 0.625, 1.25 or 10ms
units.
This is especially useful when comparing related values using
different units, such as advertising interval (0.625ms units)
and periodic advertising interval units (1.25ms units).
Users will have to be aware that these macros can provide slightly
different values than what is provided, if the provided values
do not match the units.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
ADR status and devtime updated flags merged into an atomic bits array.
Related to Issue #55072
Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>
Signed-off-by: romain pelletant <romain.pelletant@fullfreqs.com>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
Change downlink callback to transport data using flags.
Related to Issue #55072
Co-authored-by: Jan Kowalewski <jkowalewski@cthings.co>
Signed-off-by: romain pelletant <romainp@kickmaker.net>
Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
If network interface is specified in the DNS server, then send
the queries to the server via the network interface. Print this
information in the server list.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow user to specify a network interface in the DNS server
list. User can append "%" and network interface name to the
DNS server to use this. If the network interface is mentioned
in the server list, then the DNS queries are sent via this network
interface.
For example setting the interfaces like this:
192.0.2.2%eth1
[2001:db8::2]:5353%ppp0
would cause the DNS queries to sent to 192.0.2.1 via eth1 in the first
example, and to 2001:db8::2 via ppp0 in the second example.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If trying to parse a string like 192.0.2.2:80/foobar and
setting the length to 12 which means to parse the IP address
and port, the parsing failed because it used one extra character
from the string. This issue was not present if the input string
was terminated after the port number.
Add a test case to catch this problem.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add `len` to store the result of `strlen(addr_arg)` to avoid
multiple calls to `strlen` within the `for-loop` in
`cmd_scan_filter_set_addr`.
While the performance impact may be minimal in a shell context,
storing `strlen(addr_arg)` in `len` ensures a single call,
making the code more predictable and consistent.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
In case of conflicts when calling bt_id_find_conflict
there was no way to easily determine what conflicted.
This is a rare occurance, but has happened when testing
against PTS.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add an alternate message output option in which messages are
ended with an additional zero data byte with marker and timestamp.
Can be used to maintain compatibility with certain decoders.
Signed-off-by: Juha Sunnari <juha.sunnari@nordicsemi.no>
The newly introduced `frame_incomplete` flag of
`display_buffer_descriptor` needed to be added at several places to
avoid uninitialized memory.
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
Add a new API to cancel just one, or mathing requests,
instead of cancelling all ongoing requests.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
poll() only for sockets that have traffic ongoing or have some lifetime
left.
On socket failures during a poll(), stop listening for the socket.
Application can recover by reconnecting the socket.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When the client fails when parsing the response and we stop proceeding,
we should report that to the application.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Even if we receive duplicate confirmable message, we should still
respond with the Ack. Just don't deliver the second callback.
This is achieved by moving the MID deduplication to after Ack handling.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Return the -errno when zsock_sendto() or zsock_recvfrom() fails, so
rest of the code can deal with return values, instead of separately
comparing errno and return value.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When response is received and handled, don't just clear the structure
but instead mark it as ongoing=false.
So if we later on receive a duplicate response for it, we can still
respond with Ack or Rst.
This is achieved by using release_internal_request() when we don't
expect any response for it and reset_internal_request() when we really
fill up a new request.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The sock_obj_core_dealloc() was not called if close() is called
instead of zsock_close(). This happens if POSIX API is enabled.
Fix this by calling zvfs_close() from zsock_close() and then
pass the socket number to zsock_close_ctx() so that the cleanup
can be done properly.
Reported-by: Andreas Ålgård <aal@ixys.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Responses are currently set to the shell device that was configured
in the device tree.
The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.
This patch causes smp_shell_tx_raw to use the shell_uart device
Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
If we could not fragment the IPv6 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If we could not fragment the IPv4 packet, then drop it and do
not try to send it. Let the upper layer re-send the packet if
needed. It is causing more trouble if we try to send the packet
and not honor the MTU setting.
Fixes#81021
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
SNTP simple runs request iterations with exponential backoff.
If the net interface is a slower connection (ie. CAT M1 modems)
then the request will be sent but the response may take time to
be received, thus causing a timeout and another request to be sent.
Because of the nature of UDP and the fact that the same socket
(source IP/port combo) is being used for both requests, a delayed
response to the first request can be received as the response to the
second request, causing -EINVAL to be returned when the timestamps
mismatch (see subsys/net/lib/sntp/sntp.c). The solution provided
retries receiving the response when the timestamp is mismatched
(without sending an additional request).
Signed-off-by: Marcus Penate <marcus.penate@ellenbytech.com>
The doc on `_bt_gatt_ccc.value` specifies that only connected peers
contribute to that value. But before this change, it was computed from
all entries in `_bt_gatt_ccc.cfg`, which include bonded but not
connected peers when `CONFIG_BT_SETTINGS_CCC_LAZY_LOADING` is set.
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
If the lock request was rejected by a set member we should
restore any previously written logs in reverse order.
However there was a off-by-one error in
csip_set_coordinator_write_lock_cb which caused us to attempt to
release member[1] instead of member[0] if member[1] was the
one that rejected the lock request.
Additionally, the lock_set_complete would be called
prematurely before we get the response from the restore
request.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add condition check so that the 11k flag will be updated for set
operation only.
Fix print log error when getting 11k status.
Signed-off-by: Hui Bai <hui.bai@nxp.com>
The mp pointer is in fs_file_t and fs_dir_t so if the fs pointer is made
NULL then subsequent file I/O operations will cause a NULL pointer
exception. Removing the mount point from the list is threadsafe and
should be sufficient.
Signed-off-by: Chris Desjardins <chris@arch-embedded.com>
The state check used != instead of == to very that it entered
the streaming state for all streams.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The CONFIG_PINCTRL is removed from the board's defconfig files.
Drivers which use pin control function should add "select PINCTRL"
in their Kconfig files.
Fixes#78619
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
If a device disconnects while we are in a procedure then
get_next_active_instance would return a service instance pointer
with the `conn` set to NULL.
The issue was caused by the set_info being potentially memset
when the device that disconnected was the one that held the
set_info pointer.
The solution is to not use a pointer, but rather a copy of the
set_info, so that the active.set_info value is still valid
after a disconnect.
Since the set_info is not longer a pointer to a specific
set_info from one of the members, the logs have been updated
as well, as the pointer of the active.set_info is useless
for debugging.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
const is ignored on the function return type. A warning is reported with
-Wignored-qualifers. Remove the ignored const.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Remove CONFIG_MMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the mmc_subsys disk driver to be registered.
Add disk-name properties for all in tree definitions for the
mmc-subsys disk driver, and change all in tree usage of the disk name
Fixes#75004
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Remove CONFIG_SDMMC_VOLUME_NAME, and set the disk name based on the
``disk-name`` property. This aligns with other disk drivers, and allows
for multiple instances of the sdmmc_subsys disk driver to be registered.
Add disk-name properties for all in tree definitions for the
sdmmc-subsys disk driver, and change all in tree usage of the disk name
Fixes#75004
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Instead of checking the `enabled` flag, check if BT_MESH_SUSPENDED is
set in the legacy advertiser thread. BT_MESH_SUSPENDED is set earlier
than advertiser is stopped and will prevent the advertiser send anything
earlier.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Fix spurious ISO Sync Receiver stall due to uninitialised
value accessed due to regression introduced by
commit 64faceea72 ("Bluetooth: controller: Stop Sync ISO
ticker when establishment fails").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
As part of TinyCrypt deprecation process (#79566) this commit
removes usage of this library from the JWT subsystem and its
related tests.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Following the deprecation of TinyCrypt (#79566) we remove
TinyCrypt usage in random generators. This basically only affects
the CTR-DRBG random generator which from now only will only make
use of Mbed TLS.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>