From f8bce3823ad1db64735a2d2492d81b5d19aba16e Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Wed, 15 Apr 2020 14:14:38 +0100 Subject: [PATCH] Allow for a seperate FM timeout value. --- Conf.cpp | 10 +++++++++- Conf.h | 2 ++ MMDVM.ini | 1 + MMDVMHost.cpp | 2 +- Version.h | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index 0f62639..d97fae7 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -190,6 +190,7 @@ m_fmAckFrequency(1750U), m_fmAckMinTime(5U), m_fmAckDelay(1000U), m_fmAckLevel(80.0F), +m_fmTimeout(180U), m_fmTimeoutLevel(80.0F), m_fmCTCSSFrequency(88.6F), m_fmCTCSSThreshold(10.0F), @@ -391,7 +392,7 @@ bool CConf::read() } else if (::strcmp(key, "Id") == 0) m_id = m_p25Id = m_dmrId = (unsigned int)::atoi(value); else if (::strcmp(key, "Timeout") == 0) - m_timeout = (unsigned int)::atoi(value); + m_fmTimeout = m_timeout = (unsigned int)::atoi(value); else if (::strcmp(key, "Duplex") == 0) m_duplex = ::atoi(value) == 1; else if (::strcmp(key, "ModeHang") == 0) @@ -734,6 +735,8 @@ bool CConf::read() m_fmAckDelay = (unsigned int)::atoi(value); else if (::strcmp(key, "AckLevel") == 0) m_fmAckLevel = float(::atof(value)); + else if (::strcmp(key, "Timeout") == 0) + m_fmTimeout = (unsigned int)::atoi(value); else if (::strcmp(key, "TimeoutLevel") == 0) m_fmTimeoutLevel = float(::atof(value)); else if (::strcmp(key, "CTCSSFrequency") == 0) @@ -1573,6 +1576,11 @@ float CConf::getFMAckLevel() const return m_fmAckLevel; } +unsigned int CConf::getFMTimeout() const +{ + return m_fmTimeout; +} + float CConf::getFMTimeoutLevel() const { return m_fmTimeoutLevel; diff --git a/Conf.h b/Conf.h index 84127a4..87c5fc9 100644 --- a/Conf.h +++ b/Conf.h @@ -188,6 +188,7 @@ public: unsigned int getFMAckMinTime() const; unsigned int getFMAckDelay() const; float getFMAckLevel() const; + unsigned int getFMTimeout() const; float getFMTimeoutLevel() const; float getFMCTCSSFrequency() const; float getFMCTCSSThreshold() const; @@ -449,6 +450,7 @@ private: unsigned int m_fmAckMinTime; unsigned int m_fmAckDelay; float m_fmAckLevel; + unsigned int m_fmTimeout; float m_fmTimeoutLevel; float m_fmCTCSSFrequency; float m_fmCTCSSThreshold; diff --git a/MMDVM.ini b/MMDVM.ini index c7b70a4..d64eddd 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -158,6 +158,7 @@ AckFrequency=1750 AckMinTime=4 AckDelay=1000 AckLevel=80 +# Timeout=180 TimeoutLevel=80 CTCSSFrequency=88.8 CTCSSThreshold=10 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 132b3ad..73561c5 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -623,7 +623,7 @@ int CMMDVMHost::run() unsigned int ackMinTime = m_conf.getFMAckMinTime(); unsigned int ackDelay = m_conf.getFMAckDelay(); float ackLevel = m_conf.getFMAckLevel(); - unsigned int timeout = m_conf.getTimeout(); + unsigned int timeout = m_conf.getFMTimeout(); float timeoutLevel = m_conf.getFMTimeoutLevel(); float ctcssFrequency = m_conf.getFMCTCSSFrequency(); float ctcssThreshold = m_conf.getFMCTCSSThreshold(); diff --git a/Version.h b/Version.h index 118163d..a8bedbc 100644 --- a/Version.h +++ b/Version.h @@ -19,6 +19,6 @@ #if !defined(VERSION_H) #define VERSION_H -const char* VERSION = "20200414"; +const char* VERSION = "20200415"; #endif