Commit graph

11 commits

Author SHA1 Message Date
Aleksander Wasaznik c6ad4a7927 Bluetooth: samples: Switch to one-time adv
This patch removes all uses of the adv auto-resume feature in the
Bluetooth samples. The auto-resume feature is planned for deprecation.

Samples that are not intended to demonstrate a technique to do with
re-connection simply do not restart the advertiser, in interest of
simplicity. The user is expected to reboot the sample when needed.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-29 10:48:04 -07:00
Théo Battrel 7bc63985af Bluetooth: Samples: Remove uses of auto name in AD
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.

Update the samples that were using those options by explicitly adding
the device name in the advertising data or the scan response data.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-23 12:42:24 +02:00
Rubin Gerritsen f086afd47c samples: Bluetooth: Only connect to devices with rssi below -50
When the Bluetooth central samples in an open air environment
it is very likely that there are multiple devices nearby with
a received signal strength stronger than -70 dBm.

To avoid connecting to the wrong device, make the check stricter.

For tests using those samples, the NtNcable attenuation is changed
from the default 60 dBm to 40 dBm to satisfy the new requirement.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-02-26 14:34:07 +01:00
Lingao Meng 786b9a0ad4 Bluetooth: Host: Add const prefix for UUID
Add const prefix for service uuid and char uuid.

Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.

The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2023-12-07 16:16:43 +00:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Keith Packard 0b90fd5adf samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Most of these changes were automated using coccinelle with the following
script:

@@
@@
- void
+ int
main(...) {
	...
-	return;
+	return 0;
	...
}

Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Jonathan Rico 15c77acfb4 tests: Bluetooth: fix att_mtu warnings on gcc-12
The warnings are correct, we were copying 17 bytes from a 4-byte source.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-03-13 15:58:33 +01:00
Alberto Escolar Piedras a8bd8e21f6 samples/bluetooth/mtu_update: Relax RSSI requirement
The sample was only willing to connect if the pair RSSI level
was over -40dBm. That is ok when testing physically keeping
devices at less than ~1 meter from each other.
But in CI we test with a default attenuation of 60dB between
devices and the Tx power is 0dBm.
Which causes the tests based on this sample to fail.

Fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-03-07 08:34:26 +01:00
Théo Battrel 4314480826 Bluetooth: Update Readme of large MTU sample
Update the Readme file of the large mtu sample because the orginal PR
(https://github.com/zephyrproject-rtos/zephyr/pull/53593) has been merged
before the last comment could be addressed.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-01-16 16:51:42 +01:00
Théo Battrel 00a4a0720f Bluetooth: Update README of MTU update sample
Update the README to add more informations on MTUs. Also add a diagram of
the different MTU and Kconfig symbols in the Host.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-01-16 10:01:27 +01:00
Théo Battrel 7e23294bc5 Bluetooth: Add a sample to demonstrate MTU update
Add a new sample that demonstrate how to exchange MTU to allow larger
packet transmission.

The sample is split in two applications. One is the Central, it will
initiate the MTU exchange. The other one is the Peripheral and will try to
send a large notification. If the MTU exchange fail or the new size is not
big enough, the Peripheral will not be able to send the notification.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-01-16 10:01:27 +01:00