Move getSignalQuality to json.cpp

This commit is contained in:
Travis J Dean 2020-03-30 04:41:42 -04:00
parent de63bdac39
commit 40ac760285
3 changed files with 20 additions and 21 deletions

View File

@ -249,6 +249,26 @@ void serializeState(JsonObject root)
}
}
//by https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp
int getSignalQuality(int rssi)
{
int quality = 0;
if (rssi <= -100)
{
quality = 0;
}
else if (rssi >= -50)
{
quality = 100;
}
else
{
quality = 2 * (rssi + 100);
}
return quality;
}
void serializeInfo(JsonObject root)
{
root["ver"] = versionString;

View File

@ -845,23 +845,3 @@ void WLED::handleConnection()
}
}
}
//by https://github.com/tzapu/WiFiManager/blob/master/WiFiManager.cpp
int getSignalQuality(int rssi)
{
int quality = 0;
if (rssi <= -100)
{
quality = 0;
}
else if (rssi >= -50)
{
quality = 100;
}
else
{
quality = 2 * (rssi + 100);
}
return quality;
}

View File

@ -376,7 +376,6 @@ extern int loops;
bool oappend(const char *txt);
// append new number to temp buffer efficiently
bool oappendi(int i);
int getSignalQuality(int rssi);
class WLED
{