diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/system_serial-proxy.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/conf_mode/system_serial-proxy.py b/src/conf_mode/system_serial-proxy.py index 83369d39d..007277918 100755 --- a/src/conf_mode/system_serial-proxy.py +++ b/src/conf_mode/system_serial-proxy.py @@ -43,12 +43,12 @@ def get_config(): for serial_port in conf.list_nodes(['device']): conf.set_level(base + ['device', serial_port]) serial = { - 'data_bits': '', - 'parity': '', + 'data_bits': '8', + 'parity': 'none', 'port': '', 'serial_port': '/dev/serial/by-bus/' + serial_port, 'speed': '', - 'stop_bits': '', + 'stop_bits': '1', 'timeout': '600' } @@ -80,10 +80,11 @@ def verify(proxy): raise ConfigError('Serial interface "{serial_port} does not exist"' .format(**device)) - for key in ['data_bits', 'parity', 'port', 'speed', 'stop_bits']: - if not device[key]: - value = key.replace('_','-') - raise ConfigError(f'{value} option must be defined!') + if not device['port']: + raise ConfigError(f'Port must be defined!') + + if not device['speed']: + raise ConfigError(f'Speed must be defined!') return None |