From 7714a23058fcf1fbffa1208fb02f854947f0617f Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 29 Nov 2019 19:47:35 +0100 Subject: modbus: Ignore unknown/unsupported types. Without this, e.g. the recently added 'IDLE' ptype of the UART decoder would cause issues. --- decoders/modbus/pd.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'decoders/modbus') diff --git a/decoders/modbus/pd.py b/decoders/modbus/pd.py index cc42721..1d012e4 100644 --- a/decoders/modbus/pd.py +++ b/decoders/modbus/pd.py @@ -929,6 +929,10 @@ class Decoder(srd.Decoder): def decode(self, ss, es, data): ptype, rxtx, pdata = data + # Ignore unknown/unsupported ptypes. + if ptype not in ('STARTBIT', 'DATA', 'STOPBIT'): + return + # Decide what ADU(s) we need this packet to go to. # Note that it's possible to go to both ADUs. if rxtx_channels[rxtx] == self.options['scchannel']: -- cgit v1.2.3-70-g09d2