added DSMR v4 parsing unit test; added alternative serial settings for DSMR v2 and v4;
This commit is contained in:
@@ -36,7 +36,7 @@ class TelegramParser(object):
|
||||
return telegram
|
||||
|
||||
def parse_line(self, line_value):
|
||||
logger.debug('Parsing line\'%s\'', line_value)
|
||||
logger.debug('Parsing line \'%s\'', line_value)
|
||||
|
||||
obis_reference, parser = self._find_line_parser(line_value)
|
||||
|
||||
|
||||
@@ -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('/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user