Skip to content

Commit

Permalink
Do not generate ranging measurements for out of range devices
Browse files Browse the repository at this point in the history
The change caf8a03
was incomplete.
  • Loading branch information
hchataing committed Jun 24, 2024
1 parent 4ac90d1 commit 5367a4f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,18 @@ impl Pica {
.app_config
.device_mac_address
.unwrap();
let local = self
let Some(local) = self
.ranging_estimator
.estimate(&device.handle, &peer_device.handle)
.unwrap_or(Default::default());
let remote = self
else {
continue;
};
let Some(remote) = self
.ranging_estimator
.estimate(&peer_device.handle, &device.handle)
.unwrap_or(Default::default());
else {
continue;
};
measurements.push(make_measurement(&peer_mac_address, local, remote));
}

Expand Down

0 comments on commit 5367a4f

Please sign in to comment.