From d88f90d0b4f5b69453edbdd4221695be022326fb Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Fri, 15 Aug 2014 08:39:51 -0500 Subject: [PATCH] Add cfg configurable report interval --- dmrlink.py | 3 ++- dmrlink_SAMPLE.cfg | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dmrlink.py b/dmrlink.py index 6467a02..9fe47d4 100755 --- a/dmrlink.py +++ b/dmrlink.py @@ -75,6 +75,7 @@ try: # Process REPORTS items in the configuration REPORTS = { 'REPORT_PEERS': config.getboolean(section, 'REPORT_PEERS'), + 'REPORT_INTERVAL': config.getint(section, 'REPORT_INTERVAL'), 'PEER_REPORT_INC_MODE': config.getboolean(section, 'PEER_REPORT_INC_MODE'), 'PEER_REPORT_INC_FLAGS': config.getboolean(section, 'PEER_REPORT_INC_FLAGS') } @@ -797,7 +798,7 @@ class IPSC(DatagramProtocol): self._master_maintenance_loop = self._master_maintenance.start(self._local['ALIVE_TIMER']) # self._reporting = task.LoopingCall(self.reporting_loop) - self._reporting_loop = self._reporting.start(10) + self._reporting_loop = self._reporting.start(REPORTS['REPORT_INTERVAL']) # Timed loop used for reporting IPSC status diff --git a/dmrlink_SAMPLE.cfg b/dmrlink_SAMPLE.cfg index 41b245f..a8ec091 100644 --- a/dmrlink_SAMPLE.cfg +++ b/dmrlink_SAMPLE.cfg @@ -10,12 +10,14 @@ PATH: /absolute/path/to/DMRlink # STDOUT REPORTING CONFIG # Enabling "REPORT_PEERS" will cause a print-out of the peers in each -# IPSC each time the periodic reporting loop runs. Likewise, the +# IPSC each time the periodic reporting loop runs, that perios is +# specifiec by "REPORT_INTERVAL" in seconds. Likewise, the # additional features listed will cause that list to either include # or not include MODE and/or SERVICE FLAG details. # [REPORTS] REPORT_PEERS: 0 +REPORT_INTERVAL: 60 PEER_REPORT_INC_MODE: 0 PEER_REPORT_INC_FLAGS: 0