Fix the RSSI reported by M17.

This commit is contained in:
Jonathan Naylor
2023-01-04 20:47:49 +00:00
parent 97a00ef2a3
commit 8004ada92c
5 changed files with 13 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2020,2022 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2020,2022,2023 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020,2021,2022 Jonathan Naylor, G4KLX
* Copyright (C) 2020,2021,2022,2023 Jonathan Naylor, G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -948,7 +948,7 @@ void CM17Control::writeJSON(const char* action, RPT_RF_STATE state, const std::s
WriteJSON("M17", json);
}
void CM17Control::writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber, float minRSSI, float maxRSSI, float aveRSSI)
void CM17Control::writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber, unsigned char minRSSI, unsigned char maxRSSI, unsigned int aveRSSI)
{
assert(action != NULL);
@@ -957,9 +957,9 @@ void CM17Control::writeJSON(const char* action, RPT_RF_STATE state, const std::s
writeJSON(json, action, state, source, dest, duration, ber);
nlohmann::json rssi;
rssi["min"] = minRSSI;
rssi["max"] = maxRSSI;
rssi["ave"] = aveRSSI;
rssi["min"] = -int(minRSSI);
rssi["max"] = -int(maxRSSI);
rssi["ave"] = -int(aveRSSI);
json["rssi"] = rssi;

View File

@@ -107,7 +107,7 @@ private:
void writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest);
void writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber);
void writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber, float minRSSI, float maxRSSI, float aveRSSI);
void writeJSON(const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber, unsigned char minRSSI, unsigned char maxRSSI, unsigned int aveRSSI);
void writeJSON(const char* action, RPT_NET_STATE state, const std::string& source, const std::string& dest);
void writeJSON(const char* action, RPT_NET_STATE state, const std::string& source, const std::string& dest, float duration);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 by Jonathan Naylor G4KLX
* Copyright (C) 2022,2023 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -11,7 +11,8 @@
"nxdn_id": {"type": "integer", "minimum": 1, "maximum": 65535},
"pocsag_ric": {"type": "integer"},
"id_type": {"type": "string", "enum": ["group", "individual"]},
"ysf_mode": {"type": "string", "enum": ["v/d_1", "v/d_2", "voice_fr", "data_fr"]},
"ysf_mode": {"type": "string", "enum": ["voice_vw", "voice_dn", "data_fr"]},
"dg-id": {"type": "integer", "minimum": 0, "maximum": 127},
"ax25_type": {"type": "string", "enum": ["sabm", "disc", "ui", "ua", "rr", "rnr", "rej", "frmr", "i"]},
"dmr_slot": {"type": "integer", "enum": [1, 2]},
"source": {"type": "string", "enum": ["rf", "network"]},
@@ -79,10 +80,11 @@
"type": "object",
"timestamp": {"$ref": "#/$defs/timestamp"},
"source_cs": {"$ref": "#/$defs/ysf_callsign"},
"destination_cs": {"$ref": "#/$defs/ysf_callsign"},
"source": {"$ref": "#/$defs/source"},
"action": {"$ref": "#/$defs/action"},
"mode": {"$ref": "#/$defs/ysf_mode"},
"dg-id": {"$ref": "#/$defs/dg-id"},
"reflector": {"$ref": "#/$defs/ysf_callsign"},
"duration": {"$ref": "#/$defs/duration"},
"loss": {"$ref": "#/$defs/loss"},
"ber": {"$ref": "#/$defs/ber"},
@@ -91,7 +93,7 @@
"max": {"$ref": "#/$defs/rssi"},
"ave": {"$ref": "#/$defs/rssi"}
},
"required": ["timestamp", "source_cs", "destination_cs", "source", "action", "mode"]
"required": ["timestamp", "source_cs", "dg-id", "source", "action", "mode"]
},
"P25": {