This commit changes how the controllerId is generated based on device
id, and disentangles the two. The controllerId is what hawkbit uses to
uniquely identify a device, and is not necessarily the same as the
device id, and should be fully customizeable by the user if needed.
Previously, all custom device ids were being prepended with
`CONFIG_BOARD`. When a user selects `CONFIG_HAWKBIT_CUSTOM_DEVICE_ID`,
they should be able to specify the full controllerId used with hawkbit,
without a forced prepend.
Signed-off-by: Neal Jackson <neal@blueirislabs.com>
Add ll_conn_get() return value check for valid connection
context.
Build command:
cmake -GNinja -DBOARD=nrf52833dk/nrf52833
-DEXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf
-DDTC_OVERLAY_FILE=boards/nrf52833dk_nrf52833_df.overlay
-DSNIPPET="bt-ll-sw-split" ../../samples/bluetooth/hci_uart
ninja
Before:
Memory region Used Size Region Size %age Used
FLASH: 283716 B 512 KB 54.11%
RAM: 109752 B 128 KB 83.73%
IDT_LIST: 0 GB 32 KB 0.00%
After:
Memory region Used Size Region Size %age Used
FLASH: 284992 B 512 KB 54.36%
RAM: 109752 B 128 KB 83.73%
IDT_LIST: 0 GB 32 KB 0.00%
After (use of `conn != NULL`):
Memory region Used Size Region Size %age Used
FLASH: 285044 B 512 KB 54.37%
RAM: 109752 B 128 KB 83.73%
IDT_LIST: 0 GB 32 KB 0.00%
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing connection handle invalidate on Controller
power up.
The connection context are zero-initialized on startup and
calls to `ll_connected_get()` would incorrectly return a
valid connection context pointer for connection handle 0.
Relates to commit fa02dc4d02 ("Bluetooth: Controller: Fix
missing reset of connection handle").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Previously, hawkbit interface only supported a url/hostname and a port,
and internally it resolves to an IP address. This does not work for
network layers that rely on NAT64, like OpenThread. Zephyr's
implementation of `getaddrinfo` is not aware of NAT64. DNS will resolve
an IPV4 address that needs to be converted to IPV6 with the NAT64
prefix.
This commit alters the Hawkbit interface to allow providing an explicit
domain name as a string via `server_domain`, and an already resolved IP
address as `server_addr`.
This commit changes the usage of `hawkbit_runtime_config.server_addr` to
point to either an IP address or domain name. It adds a new Kconfig
(`HAWKBIT_USE_DOMAIN_NAME`) to specify an explicit domain name and adds
a new variable `hawkbit_runtime_config.server_domain`. If
`HAWKBIT_USE_DOMAIN_NAME` is enabled and a user provides an IP address
to `server_addr`, the user must provide a domain name to
`server_domain`.
Signed-off-by: Neal Jackson <neal@blueirislabs.com>
It is possible to manually set link address length past 6 at runtime
and trying to generate IPv6 IID address that way. This should fail
as we could read two bytes past the address buffer. There is no issues
in the copying as the target buffer has plenty of space.
Coverity-CID: 516232
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of relaying on stddef.h being included by other headers
let's include it explicitly, following a report of it being
missing for Ubuntu 22.04 (glibc 2.35)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Recent test specification added additional test for validating
invalid packet sizes on L2CAP signaling channel. IUT is allowed
to either disconnect link, ignore packet, reject packet or
issue a warning to upper tester if other action is taken.
To keep things in line with previous check for too small size
simply ignore fixed size packets of invalid length.
This was affecting L2CAP/COS/CED/BI-11-C qualification test.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Instead of checking whether a custom implementation is present, check
whether the AEAD one is used.
This allows downstream users to expand the implementation choice with
more options.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Some ITS store module implementations may make use of them.
This is the case of the custom one in the
secure_storage.psa.its.secure_storage.custom.store test.
Instead of making transform.h conditionally available, move the definitions
to common.h and simply make them available whenever the ITS transform
module is enabled.
At the same time, remove unneeded/redundant includes/build asserts.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Instead of checking for CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_*_CUSTOM,
check for any of the existing providers.
This allows downstream users to expand the choices with more options
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The bt_csip_set_member_register kept a counter that was not
decreased when bt_csip_set_member_unregister was called.
This meant that we could register and unregister CSIS,
but we could not re-register once it had been unregistered.
This commit fixes this by removing the counter and instead
rely on the service instance state, which also requires restoring
the original service definition, as well as adding a test that would
have failed with the previous version.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Async now uses its own work queue, which means it consumes more
resources. Since not all applications need the async API, we can make
it optional without any penalty for those applications.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Device runtime is using the system workqueue to do operations
that are mostly blockers (suspend a device). This should not happen.
This commit adds an option to use dedicated queue for the device runtime
async operations.
The test for this API was assuming that the system workqueue
priority (which is cooperative) so we need to change the test priority
to be lower than the device runtime workqueue priority.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Based on a dicussion on the Bluetooth SIG GAWG reflector, it is
not allowed for a broadcast assistant to request specific BIS
indexes as well as BT_BAP_BIS_SYNC_NO_PREF in the same
request.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Based on a dicussion on the Bluetooth SIG GAWG reflector, it is
not allowed for a broadcast assistant to request specific BIS
indexes as well as BT_BAP_BIS_SYNC_NO_PREF in the same
request.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Added network type check to fix the system crash caused by non-wifi
network card calling wifi api interface
Company:BSH Crop
Signed-off-by: Chen Tao <ct05342@163.com>
"udp bind" and "udp send" commands use the same net context
variable and they fail early if the context is already used.
This prevents from using "udp send" after "udp bind", which
makes the commands hard to use for testing bidirectional
communication. Make "udp send" reuse the already bound
context if possible, and resort to allocating temporary one
otherwise.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
When execute `bt connections`, only the peer device address of selected
LE connection is flagged with `*`.
Improve the command `bt connections` to support BR connections.
Regardless of the connection type, `*` will be shown to indicate the
peer address of the current connection if the peer device address is
the peer address of selected connection.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit removes the requirement for DNS_RESOLVER. If DNS_RESOLVER is
enabled, hawkbit uses `CONFIG_DNS_RESOLVER_MAX_QUERY_LEN` for the
server_addr buffer, if disabled it uses `CONFIG_INET6_ADDRSTRLEN`.
This adheres to #89533 which removes the requirement for DNS_RESOLVER.
Signed-off-by: Neal Jackson <neal@blueirislabs.com>
This commit adds a `strnlen` length check for `server_addr` to ensure that
it will not be truncated and result in a silent failure. Instead, the
call to `hawkbit_set_config` will return -EINVAL if the supplied
`server_addr` is too long for the internal buffer.
Signed-off-by: Neal Jackson <neal@blueirislabs.com>
The hawkbit subsystem was erroneously using DNS_MAX_NAME_SIZE as the
maximum query length. This limited query strings to only 20 bytes,
truncating many domain names.
Signed-off-by: Neal Jackson <neal@blueirislabs.com>
In enum tcp_state {}, the CLOSED state was put at the last one.
When we do Sequence & Ack validation, we will need to skip the
CLOSED, LISTEN, SYNSENT states. It is easier for coding if we
put the CLOSED to the front, e.g. if state > SYNSENT. And, in
other OSes, the state sequence is normally defined like this.
Signed-off-by: Shrek Wang <inet_eman@outlook.com>
When nvs_write is called, the nvs_flash_block_cmp is used to check if
the new data to be written matches the data already on flash. This check
always fail when CONFIG_NVS_DATA_CRC is enabled, caused by the
NVS_DATA_CRC_SIZE being added to the len parameter. The pointer to the
new data does not already have the CRC part added, while the data on
flash does, and the size to be compared includes CRC section.
By removing the addition of NVS_DATA_CRC_SIZE to the compare size, only
the data without CRC is compared, which will make the compare work in
both cases.
Signed-off-by: Yonas Alizadeh <yonas.alizadeh@alfalaval.com>
The CR bit in DISC frames should be set as a command rather than a
response.
This patch fixes the rfcomm_send_disc function to correctly use
BT_RFCOMM_CMD_CR instead of BT_RFCOMM_RESP_CR when setting the CR bit in
the address field of DISC frames.
Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
Update the response callback function signature to allow the callback to
return an error code, which in turn will cause the HTTP client to abort
the download.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The return value can only be -1, errno value should be verified instead
for the actual error code.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
During previous commit of adding interface arg, wrongly change the
parameter count of 'wifi ap enable' to a small one. Change the value
to 47 can fix this issue and match the need of adding interface arg.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Add noncallable printf with string used for ztest assert/assume
macros to ensure printf-like argument validation at compile time.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Add new TLS socket option, TLS_CERT_VERIFY_CALLBACK, which allows to
register an application callback to verify certificates obtained during
the TLS handshake.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add new TLS socket option, TLS_CERT_VERIFY_RESULT, to obtain the
certificate verification result from the most recent handshake on the
socket. The option works if TLS_PEER_VERIFY_OPTIONAL was set on the
socket, in which case the handshake may succeed even if certificate
verification fails.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit removes the SHI enable in the initialization. It can be
enabled by the application explicitly calling it when needed. The SHI
backend relies on the application layer to provide a data buffer for EC
Host Commands. If SHI is enabled before this buffer is initialized,
there is a risk that the driver may access a NULL buffer, leading to a
system panic.
Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Don't reference `net_if_get_by_iface` if `CONFIG_NET_RAW_MODE=y`, since
`net_if.c` is not compiled in that case, leading to linker errors.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Receive buffer must be aligned to word when
CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC=y is set.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
In order to support working with multiple VIFs (e.g., STA + AP) add
interface as an option for all commands.
The interface can belong to same chipset or different (hypothetical).
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Useful to see what prefix is being selected for a given
IPv6 address if debugging is enabled.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Always prefer preferred IPv6 address over deprecated one
regardless of prefix length. This works now same way as in
Linux.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>