File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed
Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,4 @@ test/__pycache__/
3636/doc /html /
3737/doc /_build /
3838.pytest_cache /
39- /.pymodhis
39+ ** /.pymodhis
Original file line number Diff line number Diff line change 11Version 2.0.2
22-----------------------------------------------------------
3- * Fix Infinite sleep loop in RTU Framer
4- * Add pygments as extra requirement for repl
5- * More verbose logs for repl
3+ * Fix Issues with Serial client where in partial data was read when the response size is unknown.
4+ * Fix Infinite sleep loop in RTU Framer.
5+ * Add pygments as extra requirement for repl.
6+ * More verbose logs for repl.
67
78Version 2.0.1
89-----------------------------------------------------------
Original file line number Diff line number Diff line change @@ -512,15 +512,22 @@ def _send(self, request):
512512 return 0
513513
514514 def _wait_for_data (self ):
515+ size = 0
516+ more_data = False
515517 if self .timeout is not None and self .timeout != 0 :
516- condition = partial (lambda start , timeout : (time .time () - start ) <= timeout , timeout = self .timeout )
518+ condition = partial (lambda start , timeout :
519+ (time .time () - start ) <= timeout ,
520+ timeout = self .timeout )
517521 else :
518522 condition = partial (lambda dummy1 , dummy2 : True , dummy2 = None )
519523 start = time .time ()
520524 while condition (start ):
521- size = self ._in_waiting ()
522- if size :
525+ avaialble = self ._in_waiting ()
526+ if ( more_data and not avaialble ) or ( more_data and avaialble == size ) :
523527 break
528+ if avaialble and avaialble != size :
529+ more_data = True
530+ size = avaialble
524531 time .sleep (0.01 )
525532 return size
526533
Original file line number Diff line number Diff line change @@ -274,11 +274,6 @@ def sendPacket(self, message):
274274 _logger .debug ("Sleeping" )
275275 time .sleep (self .client .silent_interval )
276276 size = self .client .send (message )
277- # if size:
278- # _logger.debug("Changing transaction state from 'SENDING' "
279- # "to 'WAITING FOR REPLY'")
280- # self.client.state = ModbusTransactionState.WAITING_FOR_REPLY
281-
282277 self .client .last_frame_end = round (time .time (), 6 )
283278 return size
284279
You can’t perform that action at this time.
0 commit comments