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>
This commit is contained in:
parent
4affeaab20
commit
f086afd47c
|
@ -43,7 +43,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
printk("Device found: %s (RSSI %d)\n", addr_str, rssi);
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
}
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
printk("Device found: %s (RSSI %d)\n", addr_str, rssi);
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
printk("Device found: %s (RSSI %d)\n", addr_str, rssi);
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
printk("Device found: %s (RSSI %d)\n", addr_str, rssi);
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -475,7 +475,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
|
|||
printk("Device found: %s (RSSI %d)\n", addr_str, rssi);
|
||||
|
||||
/* connect only to devices in close proximity */
|
||||
if (rssi < -70) {
|
||||
if (rssi < -50) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,6 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_samples_unicast_audio_client_pr
|
|||
-testid=unicast_client
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=20e6 $@
|
||||
-D=2 -sim_length=20e6 $@ -argschannel -at=40
|
||||
|
||||
wait_for_background_jobs #Wait for all programs in background and return != 0 if any fails
|
||||
|
|
|
@ -21,6 +21,6 @@ Execute "$peripheral_exe" \
|
|||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
-D=2 -sim_length=60e6 $@ -argschannel -at=40
|
||||
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -18,6 +18,6 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_multiple_id_prj_conf\
|
|||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=4500e6 $@
|
||||
-D=2 -sim_length=4500e6 $@ -argschannel -at=40
|
||||
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -17,6 +17,6 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_throughput_prj_conf\
|
|||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
-D=2 -sim_length=60e6 $@ -argschannel -at=40
|
||||
|
||||
wait_for_background_jobs
|
||||
|
|
Loading…
Reference in a new issue