forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SwarmUtilities.cs
37 lines (36 loc) · 1.05 KB
/
SwarmUtilities.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) .NET Foundation and Contributors
// Portions Copyright (c) Eclo Solutions
// See LICENSE file in the project root for full license information.//
namespace Iot.Device.Swarm
{
internal class SwarmUtilities
{
public static OperationalQuality GetOperationalQuality(int backgroundNoiseRssi)
{
if (backgroundNoiseRssi >= -90)
{
return OperationalQuality.Bad;
}
else if (backgroundNoiseRssi >= -93)
{
return OperationalQuality.Marginal;
}
else if (backgroundNoiseRssi >= -97)
{
return OperationalQuality.OK;
}
else if (backgroundNoiseRssi >= -100)
{
return OperationalQuality.Good;
}
else if (backgroundNoiseRssi <= -105)
{
return OperationalQuality.Great;
}
else
{
return OperationalQuality.Unknown;
}
}
}
}