Skip to content

Commit 5c13168

Browse files
authored
Update rssi value more slowly (#64)
1 parent 30b3d5c commit 5c13168

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

BluetoothLEExplorer/BluetoothLEExplorer/Models/ObservableBluetoothLEDevice.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public int Compare(object x, object y)
4444
throw new InvalidOperationException("Compared objects are not ObservableBluetoothLEDevice");
4545
}
4646

47-
// If they're equal
47+
// If they're equal sort by bluetooth address
4848
if(a.RSSI == b.RSSI)
4949
{
50-
return 0;
50+
return a.BluetoothAddressAsString.CompareTo(b.BluetoothAddressAsString);
5151
}
5252

5353
// RSSI == 0 means we don't know it. Always make that the end.
@@ -417,7 +417,8 @@ private set
417417

418418
int newValue = (int)Math.Round(RssiValue.Average(), 0);
419419

420-
if (rssi != newValue)
420+
if (rssi < newValue - 2 ||
421+
rssi > newValue + 2)
421422
{
422423
rssi = newValue;
423424
OnPropertyChanged(new PropertyChangedEventArgs("RSSI"));

BluetoothLEExplorer/BluetoothLEExplorer/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" IgnorableNamespaces="uap mp uap3">
3-
<Identity Name="Microsoft.BluetoothLEExplorer" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.16.2.0" />
3+
<Identity Name="Microsoft.BluetoothLEExplorer" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.16.3.0" />
44
<mp:PhoneIdentity PhoneProductId="8fce680c-fda2-4d28-8e68-9bb7d53f192f" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
55
<Properties>
66
<DisplayName>Bluetooth LE Explorer</DisplayName>

0 commit comments

Comments
 (0)