Beacon frames can be received with association permit bit set or not,
but the correct information should be in the data given to the
application.
Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
When trying to implement a testcase for the previous commit, an error
occoured, that stopped the test from executing.
As the tests require a full IPv6 stack, the usual router solicitation
(RS) messages will be scheduled by the net stack. To avoid conflict
with RS messages the active scan test must be kept shorter than one
second, otherwise a race condition with additional packages being
reported by the fake driver might occur.
Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
The HTTP server tests are self-contained, they do not require network
environment to execute, hence should not specify "harness: net".
The consequence of specifying the harness was that HTTP server tests in
the CI were only built, and not executed, which doesn't make much sense.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The test expects this feature to be enabled.
We should therefore enable explicitly instead of relying on
default values.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Add frdm_ke17z_fgpio.overlay to add fgpio configuration, and
add update testcase.yml to add FGPIO driver test for frdm_ke17z
and frdm_ke17z512 platforms.
Updated ke17z512 gpio test pins to avoid conflicts with I2C pin.
Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
Add an emulated UART device test case. Demonstrate using the
zephyr,uart-emul bus for passing data to an emulated implementation for a
UART device driver.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
When developing Bluetooth applications, you typically run into
some errors. If you are an experienced Bluetooth developer,
you would typically have an HCI error lookup table in your memory.
Others might not.
This commit utilizes defines CONFIG_BT_DEBUG_HCI_ERR_TO_STR
and utilizes bt_hci_err_to_str() to print out HCI error strings
when enabled to improve the user experience.
Several alternatives where considered. This approach was chosen
as it had the best balance between readability, code size, and
implementation complexity.
The alternatives are listed below as a reference.
1. Macro defined format specifier:
```c
#define HCI_ERR_FMT "%s"
#define BT_HCI_ERR_TO_STR(err) (err)
#define HCI_ERR_FMT "%d"
#define BT_HCI_ERR_TO_STR(err) bt_hci_err_to_str((err))
LOG_INF("The event contained " HCI_ERR_FMT " as status",
BT_HCI_ERR_TO_STR(err));
```
Advantage: Space efficient: Code size does not increase
Disadvantage: Code becomes hard to read
2. Format specifier to always include both integer and string:
```c
static inline const char bt_hci_err_to_str(err)
{
return "";
}
LOG_INF("The event contained %s(0x%02x) as status",
bt_hci_err_to_str(err), err);
```
Advantage: Simple to use, implement, and read,
Disadvantage: Increases code size when CONFIG_BT_DEBUG_HCI_ERR_TO_STR
is disabled. The compiler seems unable to optimize away the unused
format specifier. Note: The size increase is only present when
logging is enabled.
3. Always print as string, allocate a stack variable when printing:
```c
const char *bt_hci_err_to_str(char *dst, size_t dst_size, uint8_t err)
{
snprintf(dst, dst_size, 0x%02x, err);
return dst;
}
LOG_INF("The event contained %s as status", BT_HCI_ERR_TO_STR(err));
```
Advantage: Very easy to read.
Disadvantage: Printing error codes becomes slow as it involves calling
snprint.
4. Implement a custom printf specifier, for example E.
This requires a global CONFIG_ERR_AS_STR as I assume we cannot have
one specifier for each type of error code.
Also, I assume we cannot start adding specifiers for each subsystem.
```c
#define BT_HCI_ERR_TO_STR(err) (err)
#define BT_HCI_ERR_TO_STR(err) bt_hci_err_to_str((err))
LOG_INF("The event contained %E as status", BT_HCI_ERR_TO_STR(err));
```
Advantage: Both efficient code and readable code.
Disadvantage: This requires a global CONFIG_ERR_AS_STR as I assume
we cannot have one specifier for each type of error code.
Also, I assume we cannot start adding specifiers for each subsystem.
That is, this approach is hard to implement correctly in a scalable
way.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
For the LE Audio unittests there exists a few mock files
that implement mock versions, or callbacks, for some of the
roles and features tested.
These have been moved to where they are actually used,
reducing the scope of these files.
This both allows the individual tests to implement their own
versions of it, but more importantly it prevents issues when
adding tests for these roles. For example, due to the
bap_unicast_client.c mock file, it is impossible to implement
unit tests for the unicast client, as the functions are already
defined.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the missing timeout parameter to `modem_pipe_open()` and
`modem_pipe_close()` calls.
10 seconds is the default value used in the Zephyr tree.
Fixes a regression introduced in
https://github.com/zephyrproject-rtos/zephyr/pull/74325.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The commit removes one-line overlay files, when copyrights excluded,
with direct Kconfig options selection inside testcase.yaml.
The overlays have been removed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The LSM9DS1 is a system-in-package featuring
a 3D digital linear acceleration sensor, a 3D digital angular rate
sensor and a 3D digital magnetic sensor.
This driver implements only the linear acceleration sensor and the
angular rate sensor, on the I2C bus.
This driver is without trigger support.
The driver is based on the stmemsc HAL.
link: https://www.st.com/resource/en/datasheet/lsm9ds1.pdf
Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
The modem pipe APIs include synchronous calls to open/close,
which internally use a fixed timeout of 10 seconds. The timeout
should be configurable through the APIs, anywhere from K_NO_WAIT
to K_FOREVER.
This commit adds timeout parameters to the open/close APIs, and
updates in-tree usage of the open/close APIs to explicitly
provide the previously implicit timeout of 10 seconds.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
There is problem with running this test in validation,
because of DBGR mode watchdog can't reset board by itself,
and it needs cold reset. This proves that test is not automated,
and should be exluded on this board.
Signed-off-by: Patryk Kuniecki <patryk.kuniecki@intel.com>
Expand testing for QDEC at nrf platforms.
It uses general sensor API,
however there are also nrf driver specific assumptions.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Modify the bt_bap_scan_delegator_add_src to take an address and
a sid instead of a PA sync object, so that the scan delegator
can add a source without syncing to the PA.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Raise the descriptor table span to 201 due to the inclusion of the USB
configuration descriptor.
Tested with:
$ west build -p -b it82xx2_evb tests/subsys/usb/desc_sections
-T usb.desc_sections
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Zero length arrays are only allowed at the end of the structure. Here
those were used as placeholders for BTP response creation and can be
easily replaced with common member.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Enable sysbuild for nRF5340 app core.
This automatically builds the image for the network core, making a
better user experience.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
The driver right now only allows inverting the input value, which can be
useful for differential channels but is quite confusing for single ended
ones. Implement a simple output inversion flag instead to make up for
that.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Refactors teh BIS bitfield values used for ISO
and BAP.
Previously BIT(1) meant BIS index 1, which was a Zephyr choice
in the early days of ISO, as the BT Core spec did not use
a bitfield for BIS indexes.
Later the BASS specification came along and defined that
BIT(0) meant BIS index 1, which meant that we had to shift BIS
bitfields between BAP and ISO.
This commit refactors the ISO layer to use BIT(0) for Index 1 now,
which means that there is no longer a need for conversion
between the BAP and ISO layers, and that we can use a value
range defined by a BT Core spec (BASS).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Disable the flash disk driver in the RAM driver test to prevent the
test using the wrong disk in the tests.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Prior to the fixes in the previous commits, combining a build
for native_sim with
CONFIG_CPP=y
CONFIG_POSIX_API=y
CONFIG_STD_CPP20=y
CONFIG_REQUIRES_FULL_LIBCPP=y
would fail.
It succeeds now.
This change adds a testcase to monitor that scenario in CI.
Note: this was partially necessary because the deprecation of
CONFIG_NET_SOCKETS_POSIX_NAMES is not yet complete, so there
is a dependency cycle, and also because <sys/types.h> was
pulling in the host <sys/types.h> instead of Zephyr's or one
of the embedded OSes we support.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
If the application is not explicitly scanning, then there is not
really any need to parse advertising reports nor send them to the
application.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix Advertising PDU memory allocation for redundant Periodic
Advertising related PDU allocations. The buffer count
related to Periodic Advertising was included twice.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add test cases verifying that request containing header frame with
priority flag set is processed properly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add tests cases covering interaction with dynamic resources with
POST/GET requests.
Simplify HTTP2 request generation to facilitate adding more tests.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add test case verifying that the server keeps the connection open if no
Connection: close header is present in the request.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove pointless helper functions, the test code can simply be included
in the test case w/o code duplication.
Clarify the naming of existing test cases. Backward compatibility simply
tests HTTP1. The upgrade test wasn't really testing HTTP upgrade, so
rename the test case too. Add a new test case actually verifying HTTP
upgrade.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Do some cleanup regarding naming used in the test suite to prepare it
for adding more test cases.
Extract common setup/teardown into respective before and after ztest
functions to simplify test code. Proper before and after functions also
ensure that individual test case failure does not disrupt other tests
operation.
Split the tests into two separate test suites, one for those which
require pre-setup and second for those which don't.
Finally, enable receive timeout on the client socket to ensure tests
won't stall in case of errors.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
"prototype" is ambiguous in this regard, as it doesn't really tell what
the test suite is testing. As tests in this test suite verify core HTTP
server functionality, rename it to "core".
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Change USBD_CONFIGURATION_DEFINE macro to take the address of a string
descriptor node as an argument. This is a breaking change for macro
users, but quite convenient and easy to implement.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The test case for SO_BINDTODEVICE socket option was flaky, the client
socket always sent the datagram to the IP address of the second
interface, so in theory every packet should end up on that interface.
In practice though, due to imperfect loopback packet handling, the test
worked as the packet ended up on the interface it was sent from.
The test should send datagrams to the IP addresses of the interface 1
and 2 alternatively. The server socket binds to ANY address, so w/o
interface binding it should receive all datagrams, so it allows to
verify if SO_BINDTODEVICE filtering works fine.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Change the `platform_allow` to multi-line format so that newly
supported archs/boards can be added as a new line.
Refactor the tags out to `common`, and add
`CONFIG_ARCH_HAS_GDBSTUB` filter
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The standard does allow for a optional beacon payload, which gets lost
during scan, that could be interesting for the application to access
in the NET_EVENT_IEEE802154_SCAN_RESULT callback.
See section 7.3.1.6 in IEEE Std 802.15.4 for more information about
the beacon payload field. And section 7.3.1 and figure 7-5 about general
beacon frame format.
Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
Add a zephyr/printk.h header for the __printk_hook functions, these are
currently manually declared by all console drivers for no good reason.
Move the documentation into the header and also unify the way that
console drivers call the function.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>