Add JSON RSSI and BER to P25.

This commit is contained in:
Jonathan Naylor
2023-06-11 14:58:29 +01:00
parent fb5e5b5fa1
commit c52ae58816
3 changed files with 102 additions and 35 deletions

View File

@@ -265,7 +265,7 @@ bool CYSFControl::processVWData(bool valid, unsigned char *data)
m_maxRSSI = m_rssi;
m_aveRSSI = m_rssi;
m_rssiCountTotal = 1U;
m_rssiAccum = m_rssi;
m_rssiCount = 1U;
@@ -1286,35 +1286,6 @@ void CYSFControl::enable(bool enabled)
m_enabled = enabled;
}
void CYSFControl::writeJSONRF(const char* action, const char* mode, const unsigned char* source, unsigned char dgid)
{
assert(action != NULL);
assert(mode != NULL);
assert(source != NULL);
nlohmann::json json;
writeJSONRF(json, action, source, dgid);
json["mode"] = mode;
WriteJSON("YSF", json);
}
void CYSFControl::writeJSONRF(const char* action, float duration, float ber)
{
assert(action != NULL);
nlohmann::json json;
writeJSONRF(json, action);
json["duration"] = duration;
json["ber"] = ber;
WriteJSON("YSF", json);
}
void CYSFControl::writeJSONRSSI()
{
m_rssiAccum += m_rssi;
@@ -1355,6 +1326,35 @@ void CYSFControl::writeJSONBER(unsigned int bits, unsigned int errs)
}
}
void CYSFControl::writeJSONRF(const char* action, const char* mode, const unsigned char* source, unsigned char dgid)
{
assert(action != NULL);
assert(mode != NULL);
assert(source != NULL);
nlohmann::json json;
writeJSONRF(json, action, source, dgid);
json["mode"] = mode;
WriteJSON("YSF", json);
}
void CYSFControl::writeJSONRF(const char* action, float duration, float ber)
{
assert(action != NULL);
nlohmann::json json;
writeJSONRF(json, action);
json["duration"] = duration;
json["ber"] = ber;
WriteJSON("YSF", json);
}
void CYSFControl::writeJSONRF(const char* action, float duration, float ber, unsigned char minRSSI, unsigned char maxRSSI, unsigned int aveRSSI)
{
assert(action != NULL);