File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ def is_frame_ready(self):
8282 try :
8383 self ._header ["uid" ] = int (self ._buffer [0 ])
8484 self ._header ["tid" ] = int (self ._buffer [0 ])
85+ self ._header ["tid" ] = 0 # fix for now
8586 func_code = int (self ._buffer [1 ])
8687 pdu_class = self .decoder .lookupPduClass (func_code )
8788 size = pdu_class .calculateRtuFrameSize (self ._buffer )
@@ -119,6 +120,7 @@ def check_frame(self):
119120 try :
120121 self ._header ["uid" ] = int (self ._buffer [0 ])
121122 self ._header ["tid" ] = int (self ._buffer [0 ])
123+ self ._header ["tid" ] = 0 # fix for now
122124 func_code = int (self ._buffer [1 ])
123125 pdu_class = self .decoder .lookupPduClass (func_code )
124126 size = pdu_class .calculateRtuFrameSize (self ._buffer )
Original file line number Diff line number Diff line change @@ -460,7 +460,9 @@ def getTransaction(self, tid):
460460 Log .debug ("Getting transaction {}" , tid )
461461 if not tid :
462462 if self .transactions :
463- return self .transactions .popitem ()[1 ]
463+ ret = self .transactions .popitem ()[1 ]
464+ self .transactions .clear ()
465+ return ret
464466 return None
465467 return self .transactions .pop (tid , None )
466468
Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ def callback(data):
223223 "crc" : b"\x49 \xAD " ,
224224 "uid" : 17 ,
225225 "len" : 11 ,
226- "tid" : 17 ,
226+ "tid" : 0 ,
227227 },
228228 ),
229229 (
@@ -232,7 +232,7 @@ def callback(data):
232232 "crc" : b"\x49 \xAD " ,
233233 "uid" : 17 ,
234234 "len" : 11 ,
235- "tid" : 17 ,
235+ "tid" : 0 ,
236236 },
237237 ),
238238 ],
You can’t perform that action at this time.
0 commit comments