summaryrefslogtreecommitdiff
path: root/decoders/modbus
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-07-01 00:27:17 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2019-07-01 00:27:17 +0200
commitdcf1b50dfe8c66f7a5579856d86e328e02ff986d (patch)
tree7affb2a4e3883ff97953ef20d941ba1052a09e71 /decoders/modbus
parentd4364948d0356f0659e1777cf771ed5bfc1f2072 (diff)
downloadlibsigrokdecode-dcf1b50dfe8c66f7a5579856d86e328e02ff986d.tar.gz
libsigrokdecode-dcf1b50dfe8c66f7a5579856d86e328e02ff986d.zip
modbus: Make the 'framegap' option an integer.
Diffstat (limited to 'decoders/modbus')
-rw-r--r--decoders/modbus/pd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/decoders/modbus/pd.py b/decoders/modbus/pd.py
index d5cb811..cc42721 100644
--- a/decoders/modbus/pd.py
+++ b/decoders/modbus/pd.py
@@ -848,7 +848,7 @@ class Decoder(srd.Decoder):
'default': rxtx_channels[0], 'values': rxtx_channels},
{'id': 'cschannel', 'desc': 'Client -> server channel',
'default': rxtx_channels[1], 'values': rxtx_channels},
- {'id': 'framegap', 'desc': 'Inter-frame bit gap', 'default': '28'},
+ {'id': 'framegap', 'desc': 'Inter-frame bit gap', 'default': 28},
)
def __init__(self):
@@ -912,7 +912,7 @@ class Decoder(srd.Decoder):
# somewhere between seems fine.
# A character is 11 bits long, so (3.5 + 1.5)/2 * 11 ~= 28
# TODO: Display error for too short or too long.
- if (ss - ADU.last_read) <= self.bitlength * int(self.options['framegap']):
+ if (ss - ADU.last_read) <= self.bitlength * self.options['framegap']:
ADU.add_data(ss, es, data)
else:
# It's been too long since the last part of the ADU!