Add cfg configurable report interval

This commit is contained in:
Cort Buffington 2014-08-15 08:39:51 -05:00
parent 6e899a36c2
commit d88f90d0b4
2 changed files with 5 additions and 2 deletions

View File

@ -75,6 +75,7 @@ try:
# Process REPORTS items in the configuration # Process REPORTS items in the configuration
REPORTS = { REPORTS = {
'REPORT_PEERS': config.getboolean(section, 'REPORT_PEERS'), '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_MODE': config.getboolean(section, 'PEER_REPORT_INC_MODE'),
'PEER_REPORT_INC_FLAGS': config.getboolean(section, 'PEER_REPORT_INC_FLAGS') '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._master_maintenance_loop = self._master_maintenance.start(self._local['ALIVE_TIMER'])
# #
self._reporting = task.LoopingCall(self.reporting_loop) 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 # Timed loop used for reporting IPSC status

View File

@ -10,12 +10,14 @@ PATH: /absolute/path/to/DMRlink
# STDOUT REPORTING CONFIG # STDOUT REPORTING CONFIG
# Enabling "REPORT_PEERS" will cause a print-out of the peers in each # 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 # additional features listed will cause that list to either include
# or not include MODE and/or SERVICE FLAG details. # or not include MODE and/or SERVICE FLAG details.
# #
[REPORTS] [REPORTS]
REPORT_PEERS: 0 REPORT_PEERS: 0
REPORT_INTERVAL: 60
PEER_REPORT_INC_MODE: 0 PEER_REPORT_INC_MODE: 0
PEER_REPORT_INC_FLAGS: 0 PEER_REPORT_INC_FLAGS: 0