added DSMR v4 parsing unit test; added alternative serial settings for DSMR v2 and v4;

This commit is contained in:
Nigel Dokter
2016-11-20 12:44:45 +01:00
parent f41fe0894c
commit 927a4bc8e7
6 changed files with 265 additions and 10 deletions

View File

@@ -13,7 +13,27 @@ SERIAL_SETTINGS_V2_2 = {
'timeout': 20
}
SERIAL_SETTINGS_V2_2_EVEN = {
'baudrate': 9600,
'bytesize': serial.SEVENBITS,
'parity': serial.PARITY_EVEN,
'stopbits': serial.STOPBITS_ONE,
'xonxoff': 0,
'rtscts': 0,
'timeout': 20
}
SERIAL_SETTINGS_V4 = {
'baudrate': 115200,
'bytesize': serial.SEVENBITS,
'parity': serial.PARITY_NONE,
'stopbits': serial.STOPBITS_ONE,
'xonxoff': 0,
'rtscts': 0,
'timeout': 20
}
SERIAL_SETTINGS_V4_EVEN = {
'baudrate': 115200,
'bytesize': serial.SEVENBITS,
'parity': serial.PARITY_EVEN,
@@ -24,6 +44,7 @@ SERIAL_SETTINGS_V4 = {
}
def is_start_of_telegram(line):
return line.startswith('/')