Decoder Update : can put error when Bit Stuffing error(111111 or 000000)

This commit is contained in:
yunyaobaihong 2024-06-19 10:11:49 +08:00
parent d17440a862
commit 974c336cdb

View File

@ -21,6 +21,7 @@
##
## 2024/3/28 DreamSourceLab : Display data when zooming out
## 2024/6/18 DreamSourceLab : put error when stuff error
##
from common.srdhelper import bitpack_msb
@ -154,6 +155,8 @@ class Decoder(srd.Decoder):
if len(self.bits) > self.last_databit + 17:
return False
last_6_bits = self.rawbits[-6:]
if last_6_bits in ([1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0]):
self.putx([16, ['Stuff Error' ,'Error','E']])
if last_6_bits not in ([0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 0]):
return False