mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 08:45:48 +08:00
Simplify the JSON creation, remove duplication of effort.
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
class CM17Control {
|
||||
public:
|
||||
CM17Control(const std::string& callsign, unsigned int can, bool selfOnly, bool allowEncryption, CM17Network* network, CDisplay* display, unsigned int timeout, bool duplex, CRSSIInterpolator* rssiMapper);
|
||||
@@ -109,6 +111,10 @@ private:
|
||||
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);
|
||||
|
||||
void writeJSON(nlohmann::json& json, const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest);
|
||||
void writeJSON(nlohmann::json& json, const char* action, RPT_RF_STATE state, const std::string& source, const std::string& dest, float duration, float ber);
|
||||
void writeJSON(nlohmann::json& json, const char* action, RPT_NET_STATE state, const std::string& source, const std::string& dest);
|
||||
|
||||
bool openFile();
|
||||
bool writeFile(const unsigned char* data);
|
||||
void closeFile();
|
||||
|
||||
Reference in New Issue
Block a user