Added ability to send options to master
This commit is contained in:
parent
6bff580a6f
commit
aafb321f8a
@ -114,7 +114,8 @@ def build_config(_config_file):
|
||||
'URL': config.get(section, 'URL').ljust(124)[:124],
|
||||
'SOFTWARE_ID': config.get(section, 'SOFTWARE_ID').ljust(40)[:40],
|
||||
'PACKAGE_ID': config.get(section, 'PACKAGE_ID').ljust(40)[:40],
|
||||
'GROUP_HANGTIME': config.getint(section, 'GROUP_HANGTIME')
|
||||
'GROUP_HANGTIME': config.getint(section, 'GROUP_HANGTIME'),
|
||||
'OPTIONS': config.get(section, 'OPTIONS')
|
||||
}})
|
||||
CONFIG['SYSTEMS'][section].update({'STATS': {
|
||||
'CONNECTION': 'NO', # NO, RTPL_SENT, AUTHENTICATED, CONFIG-SENT, YES
|
||||
|
@ -101,4 +101,5 @@ DESCRIPTION: This is a cool repeater
|
||||
URL: www.w1abc.org
|
||||
SOFTWARE_ID: HBlink
|
||||
PACKAGE_ID: v0.1
|
||||
GROUP_HANGTIME: 5
|
||||
GROUP_HANGTIME: 5
|
||||
OPTIONS:
|
16
hblink.py
16
hblink.py
@ -425,8 +425,22 @@ class HBSYSTEM(DatagramProtocol):
|
||||
elif self._stats['CONNECTION'] == 'CONFIG-SENT': # If we've sent out configuration to the master
|
||||
if _data[6:10] == self._config['RADIO_ID']:
|
||||
self._logger.info('(%s) Repeater Configuration Accepted', self._system)
|
||||
if self._config['OPTIONS'] != "":
|
||||
self.send_master('RPTO'+self._config['RADIO_ID']+self._config['OPTIONS'])
|
||||
self._stats['CONNECTION'] = 'OPTIONS-SENT'
|
||||
self._logger.info('(%s) Sent options: '+self._config['OPTIONS'], self._system)
|
||||
else:
|
||||
self._stats['CONNECTION'] = 'YES'
|
||||
self._logger.info('(%s) Connection to Master Completed', self._system)
|
||||
else:
|
||||
self._stats['CONNECTION'] = 'NO'
|
||||
self._logger.error('(%s) Master ACK Contained wrong ID - Connection Reset', self._system)
|
||||
|
||||
elif self._stats['CONNECTION'] == 'OPTIONS-SENT': # If we've sent out options to the master
|
||||
if _data[6:10] == self._config['RADIO_ID']:
|
||||
self._logger.info('(%s) Repeater Options Accepted', self._system)
|
||||
self._stats['CONNECTION'] = 'YES'
|
||||
self._logger.info('(%s) Connection to Master Completed', self._system)
|
||||
self._logger.info('(%s) Connection to Master Completed with options', self._system)
|
||||
else:
|
||||
self._stats['CONNECTION'] = 'NO'
|
||||
self._logger.error('(%s) Master ACK Contained wrong ID - Connection Reset', self._system)
|
||||
|
Loading…
Reference in New Issue
Block a user