From bd7e59d1b2a6597faad011fcc93dbe8b592e56f5 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 9 Apr 2018 11:55:40 -0700 Subject: [PATCH] it works! --- g2.everything.cfg | 33 +++++++++++++++++++++++++++++---- g2_link.cpp | 8 ++------ mmdvm_modem.cpp | 10 +++++----- mmdvm_modem.h | 2 +- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/g2.everything.cfg b/g2.everything.cfg index 8f92122..724bf15 100644 --- a/g2.everything.cfg +++ b/g2.everything.cfg @@ -26,10 +26,28 @@ gateway = { } module = { - a = { -# type = "" + a = { # An MMDVMHost module is shown + # make sure this module letter agrees with the [D-Star] Module letter in MMDVM.ini + # in MMDVM.ini its uppercase, here use lower case. + # We show a here, but the convention on this software is: + # 23 cm modules will use "a" + # 70 cm modules will use "b" + # 2 M module will use "c" + type = "mmdvm" # ip = "127.0.0.1" -# port = 19998 # default for mod a +# port = 19998 # default for mod a, you usually don't need to specify this +# frequency = 0 # if you specify here, this frequency will show up on the QuadNet USER GATEWAYS webpage +# offset = 0 +# range = 0 # the range of this repeater, in meters 1609.344 meters is 1.0 miles +# agl = 0 # the height above ground level for this repeater's antenna +# latitude = 0 # you can leave this unspecified for a mobile rig +# longitude = 0 # like the latitude +# desc1 = "" # maximum of 20 characters, most special symbols are not allowed +# desc2 = "" # just like desc1 +# url = "github.com/n7tae/g2_ircddb" # 80 characters max + # In review, for an MMDVM module, you only need to specify the type = "mmdvm" and + # make sure the module letter agrees with what's in "MMDVM.ini. + # Also see the mmdvm section below, although it usually doesn't need specifying. } b = { @@ -42,7 +60,7 @@ module = { # Otherwise do not set callsign and we will use ircddb.username # callsign = "" - # the frequency of your DVAP in MHz. + # the frequency of your DVRPTR in MHz. # frequency = 145.5 # the TX/RX offset in MHz, use 0.0 for simplex @@ -221,6 +239,13 @@ module = { } } +# you only need this mmdvm section if you set non-standard D-Star ports on your MMDVMHost software +mmdvm = { +# these need to be the same as they are in your MMDVM.ini file (in the [D-Star Network] section +# If you change them there, then change them here! +# gateway_port = 20010 +# local_port = 20011 +} log = { # debuging and extra logging switches diff --git a/g2_link.cpp b/g2_link.cpp index 8f1ea8e..f623b02 100644 --- a/g2_link.cpp +++ b/g2_link.cpp @@ -3322,8 +3322,7 @@ static void runit() (readBuffer[17] == 0x08) || (readBuffer[17] == 0x20) || (readBuffer[17] == 0x28))) { - if (only_link_unlink && - (link_unlink_user.find(call) == link_unlink_user.end())) { + if (only_link_unlink && (link_unlink_user.find(call) == link_unlink_user.end())) { traceit("link request denied, unauthorized rf user [%s]\n", call); } else { memset(temp_repeater, ' ', CALL_SIZE); @@ -3340,10 +3339,7 @@ static void runit() space_p = strchr(linked_remote_system, ' '); if (space_p) *space_p = '\0'; - sprintf(notify_msg, "%c_already_linked.dat_LINKED_%s_%c", - to_remote_g2[i].from_mod, - linked_remote_system, - to_remote_g2[i].to_mod); + sprintf(notify_msg, "%c_already_linked.dat_LINKED_%s_%c", to_remote_g2[i].from_mod, linked_remote_system, to_remote_g2[i].to_mod); audio_notify(notify_msg); } } diff --git a/mmdvm_modem.cpp b/mmdvm_modem.cpp index a1bb008..9316454 100644 --- a/mmdvm_modem.cpp +++ b/mmdvm_modem.cpp @@ -449,16 +449,16 @@ bool CMMDVMModem::ReadConfig(const char *cfgFile) } else return true; - GetValue(cfg, std::string(mmdvm_path+".g2_in_port").c_str(), i, 10000, 65535, 19000); + GetValue(cfg, "gateway.internal.port", i, 10000, 65535, 19000); G2_IN_PORT = (unsigned short)i; - GetValue(cfg, std::string(mmdvm_path+".g2_out_port").c_str(), i, 10000, 65535, 19998+repeater_module); + GetValue(cfg, std::string(mmdvm_path+".port").c_str(), i, 10000, 65535, 19998+repeater_module); G2_OUT_PORT = (unsigned short)i; - GetValue(cfg, std::string(mmdvm_path+".mmdvm_in_port").c_str(), i, 10000, 65535, 20011); + GetValue(cfg, "mmdvm.local_port", i, 10000, 65535, 20011); MMDVM_IN_PORT = (unsigned short)i; - GetValue(cfg, std::string(mmdvm_path+".mmdvm_out_port").c_str(), i, 10000, 65535, 20010); + GetValue(cfg, "mmdvm.gateway_port", i, 10000, 65535, 20010); MMDVM_OUT_PORT = (unsigned short)i; if (GetValue(cfg, "gateway.ip", value, 7, IP_SIZE, "127.0.0.1")) { @@ -477,7 +477,7 @@ bool CMMDVMModem::ReadConfig(const char *cfgFile) return false; } -void CMMDVMModem::SignalCatch(int signum) +void CMMDVMModem::SignalCatch(const int signum) { if ((signum == SIGTERM) || (signum == SIGINT) || (signum == SIGHUP)) keep_running = false; diff --git a/mmdvm_modem.h b/mmdvm_modem.h index 0825c14..80375bc 100644 --- a/mmdvm_modem.h +++ b/mmdvm_modem.h @@ -43,7 +43,7 @@ public: private: // functions bool Initialize(const char *cfgfile); - static void SignalCatch(int signum); + static void SignalCatch(const int signum); bool ProcessGateway(const int len, const unsigned char *raw); bool ProcessMMDVM(const int len, const unsigned char *raw); int OpenSocket(const std::string &address, unsigned short port);