From 5b1396ac419bdad2744af5fc652dd5a1a89d6d5f Mon Sep 17 00:00:00 2001 From: Tom Early Date: Thu, 3 Jan 2019 09:34:34 -0700 Subject: [PATCH] changed unix port names between gateway and modems --- QnetDVAP.cpp | 4 ++-- QnetDVRPTR.cpp | 4 ++-- QnetGateway.cpp | 4 ++-- QnetITAP.cpp | 6 +++--- QnetRelay.cpp | 4 ++-- configure | 13 +++---------- defaults | 12 ++++++------ 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/QnetDVAP.cpp b/QnetDVAP.cpp index 09ddb9d..8b9b267 100644 --- a/QnetDVAP.cpp +++ b/QnetDVAP.cpp @@ -202,8 +202,8 @@ static bool read_config(const char *cfgFile) } } RPTR_MOD = 'A' + assigned_module; - cfg.GetValue(dvap_path+"_gate2modem"+std::to_string(assigned_module), type, gate2modem, 1, FILENAME_MAX); - cfg.GetValue(dvap_path+"_modem2gate"+std::to_string(assigned_module), type, modem2gate, 1, FILENAME_MAX); + cfg.GetValue(dvap_path+"_gate2modem"+std::string(1, 'a'+assigned_module), type, gate2modem, 1, FILENAME_MAX); + cfg.GetValue(dvap_path+"_modem2gate"+std::string(1, 'a'+assigned_module), type, modem2gate, 1, FILENAME_MAX); if (cfg.KeyExists(dvap_path+"_callsign")) { if (cfg.GetValue(dvap_path+"_callsign", type, RPTR, 3, 6)) return true; diff --git a/QnetDVRPTR.cpp b/QnetDVRPTR.cpp index 44520f1..c9fc4cb 100644 --- a/QnetDVRPTR.cpp +++ b/QnetDVRPTR.cpp @@ -1855,8 +1855,8 @@ static bool read_config(const char *cfgFile) } } DVRPTR_MOD = 'A' + assigned_module; - cfg.GetValue(path+"_gate2modem"+std::to_string(assigned_module), type, gate2modem, 1, FILENAME_MAX); - cfg.GetValue(path+"_modem2gate"+std::to_string(assigned_module), type, modem2gate, 1, FILENAME_MAX); + cfg.GetValue(path+"_gate2modem"+std::string(1, 'a'+assigned_module), type, gate2modem, 1, FILENAME_MAX); + cfg.GetValue(path+"_modem2gate"+std::string(1, 'a'+assigned_module), type, modem2gate, 1, FILENAME_MAX); std::string call; if (cfg.GetValue("ircddb_login", type, call, 3, 6)) diff --git a/QnetGateway.cpp b/QnetGateway.cpp index 9a64966..a2767f3 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -220,8 +220,8 @@ bool CQnetGateway::read_config(char *cfgFile) rptr.mod[m].defined = true; path.append(1, '_'); - cfg.GetValue(path+"togateway", type, modem2gate[m], 1, FILENAME_MAX); - cfg.GetValue(path+"fromgateway", type, gate2modem[m], 1, FILENAME_MAX); + cfg.GetValue(path+"modem2gate"+std::string(1, 'a'+m), type, modem2gate[m], 1, FILENAME_MAX); + cfg.GetValue(path+"gate2modem"+std::string(1, 'a'+m), type, gate2modem[m], 1, FILENAME_MAX); cfg.GetValue(path+"frequency", type, rptr.mod[m].frequency, 0.0, 1.0e12); cfg.GetValue(path+"offset", type, rptr.mod[m].offset, -1.0e12, 1.0e12); cfg.GetValue(path+"range", type, rptr.mod[m].range, 0.0, 1609344.0); diff --git a/QnetITAP.cpp b/QnetITAP.cpp index c3deeb3..f2db07b 100644 --- a/QnetITAP.cpp +++ b/QnetITAP.cpp @@ -198,7 +198,7 @@ void CQnetITAP::Run(const char *cfgfile) int ug2m = Gate2Modem.GetFD(); int um2g = Modem2Gate.GetFD(); - printf("gate2modem=%d, modem2gate=%d seral=%d\n", ug2m, um2g, serfd); + printf("gate2modem=%d, modem2gate=%d serial=%d\n", ug2m, um2g, serfd); keep_running = true; unsigned poll_counter = 0; @@ -501,8 +501,8 @@ bool CQnetITAP::ReadConfig(const char *cfgFile) RPTR_MOD = 'A' + assigned_module; cfg.GetValue(itap_path+"_device", type, ITAP_DEVICE, 7, FILENAME_MAX); - cfg.GetValue(itap_path+"_gate2modem"+std::to_string(assigned_module), type, gate2modem, 1, FILENAME_MAX); - cfg.GetValue(itap_path+"_modem2gate"+std::to_string(assigned_module), type, modem2gate, 1, FILENAME_MAX); + cfg.GetValue(itap_path+"_gate2modem"+std::string(1, 'a'+assigned_module), type, gate2modem, 1, FILENAME_MAX); + cfg.GetValue(itap_path+"_modem2gate"+std::string(1, 'a'+assigned_module), type, modem2gate, 1, FILENAME_MAX); itap_path.append("_callsign"); if (cfg.KeyExists(itap_path)) { diff --git a/QnetRelay.cpp b/QnetRelay.cpp index cb57f53..81ca076 100644 --- a/QnetRelay.cpp +++ b/QnetRelay.cpp @@ -394,8 +394,8 @@ bool CQnetRelay::ReadConfig(const char *cfgFile) } RPTR_MOD = 'A' + assigned_module; - cfg.GetValue(mmdvm_path+"_gate2modem"+std::to_string(assigned_module), type, gate2modem, 1, FILENAME_MAX); - cfg.GetValue(mmdvm_path+"_modem2gate"+std::to_string(assigned_module), type, modem2gate, 1, FILENAME_MAX); + cfg.GetValue(mmdvm_path+"_gate2modem"+std::string(1, 'a'+assigned_module), type, gate2modem, 1, FILENAME_MAX); + cfg.GetValue(mmdvm_path+"_modem2gate"+std::string(1, 'a'+assigned_module), type, modem2gate, 1, FILENAME_MAX); cfg.GetValue(mmdvm_path+"_internal_ip", type, MMDVM_IP, 7, IP_SIZE); int i; cfg.GetValue(mmdvm_path+"_local_port", type, i, 10000, 65535); diff --git a/configure b/configure index 6f1d44d..4193014 100755 --- a/configure +++ b/configure @@ -420,7 +420,7 @@ ModuleMenu () { } WriteCFGFile () { - local m n p q outFile + local m p q outFile outFile='./qn.cfg' echo "# Created on `date`" > $outFile # gateway_ section @@ -432,13 +432,6 @@ WriteCFGFile () { # module_?_ section for m in a b c do - if [[ "$m" == a ]]; then - n=0 - elif [[ "$m" == b ]]; then - n=1 - else - n=2 - fi p="module_$m" if [ -n "${!p}" ]; then echo "${p}=${!p}" >> $outFile @@ -448,8 +441,8 @@ WriteCFGFile () { q=${p}_offset; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile q=${p}_range; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile q=${p}_agl; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile - q=${p}_gate2modem${n}; [ -z ${!q+x} ] || echo "${q}='${!q}'" >> $outFile - q=${p}_modem2gate${n}; [ -z ${!q+x} ] || echo "${q}='${!q}'" >> $outFile + q=${p}_gate2modem${m}; [ -z ${!q+x} ] || echo "${q}='${!q}'" >> $outFile + q=${p}_modem2gate${m}; [ -z ${!q+x} ] || echo "${q}='${!q}'" >> $outFile q=${p}_inactivity; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile q=${p}_packet_wait; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile q=${p}_acknowledge; [ -z ${!q+x} ] || echo "${q}=${!q}" >> $outFile diff --git a/defaults b/defaults index 1f3fc01..6a1c212 100644 --- a/defaults +++ b/defaults @@ -94,12 +94,12 @@ module_x_frequency=0 # if you specify here, this frequency will show up on module_x_offset=0 # usually the duplex tx-rx offset, but for dvap, it's a frequency tweak module_x_range=0 # the range of this repeater, in meters 1609.344 meters is 1.0 miles module_x_agl=0 # the height above ground level for this repeater's antenna -module_x_gate2modem0='gate2modem0' # Unix Sockets between a modem and the gateway -module_x_gate2modem1='gate2modem1' # 0 is for A, 1 is for B and 2 is for C -module_x_gate2modem2='gate2modem2' -module_x_modem2gate0='modem2gate0' -module_x_modem2gate1='modem2gate1' -module_x_modem2gate2='modem2gate2' +module_x_gate2modem0='gate2modema' # Unix Sockets between a modem and the gateway +module_x_gate2modem1='gate2modemb' +module_x_gate2modem2='gate2modemc' +module_x_modem2gate0='modem2gatea' +module_x_modem2gate1='modem2gateb' +module_x_modem2gate2='modem2gatec' ########################################################################################################################## #