1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

guard against some decoding errors

This commit is contained in:
Joel Bender
2019-03-08 11:09:58 -05:00
parent 627bdcc2ba
commit 0d50b2092a
3 changed files with 33 additions and 13 deletions

View File

@@ -194,9 +194,13 @@ def decode_packet(data):
if (pdu.pduData[0] == '\x81'):
if _debug: decode_packet._debug(" - BVLL header found")
xpdu = BVLPDU()
xpdu.decode(pdu)
pdu = xpdu
try:
xpdu = BVLPDU()
xpdu.decode(pdu)
pdu = xpdu
except Exception as err:
if _debug: decode_packet._debug(" - BVLPDU decoding error: %r", err)
return pdu
# make a more focused interpretation
atype = bvl_pdu_types.get(pdu.bvlciFunction)