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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user