@@ -45,14 +45,6 @@ def __init__(self, decoder, client=None):
4545 # ----------------------------------------------------------------------- #
4646 # Private Helper Functions
4747 # ----------------------------------------------------------------------- #
48- def decode_data (self , data ):
49- """Decode data."""
50- if len (data ) > 1 :
51- uid = int (data [1 :3 ], 16 )
52- fcode = int (data [3 :5 ], 16 )
53- return {"slave" : uid , "fcode" : fcode }
54- return {}
55-
5648 def checkFrame (self ):
5749 """Check and decode the next frame.
5850
@@ -83,16 +75,6 @@ def advanceFrame(self):
8375 self ._buffer = self ._buffer [self ._header ["len" ] + 2 :]
8476 self ._header = {"lrc" : "0000" , "len" : 0 , "uid" : 0x00 }
8577
86- def isFrameReady (self ):
87- """Check if we should continue decode logic.
88-
89- This is meant to be used in a while loop in the decoding phase to let
90- the decoder know that there is still data in the buffer.
91-
92- :returns: True if ready, False otherwise
93- """
94- return len (self ._buffer ) > 1
95-
9678 def getFrame (self ):
9779 """Get the next frame from the buffer.
9880
@@ -110,7 +92,7 @@ def getFrame(self):
11092 # ----------------------------------------------------------------------- #
11193 def frameProcessIncomingPacket (self , single , callback , slave , _tid = None , ** kwargs ):
11294 """Process new packet pattern."""
113- while self .isFrameReady () :
95+ while len ( self ._buffer ) > 1 :
11496 if not self .checkFrame ():
11597 break
11698 if not self ._validate_slave_id (slave , single ):
0 commit comments