Move getSignalQuality to json.cpp
This commit is contained in:
parent
de63bdac39
commit
40ac760285
@ -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;
|
||||
|
@ -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;
|
||||
}
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user