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__/
36
36
/doc /html /
37
37
/doc /_build /
38
38
.pytest_cache /
39
- /.pymodhis
39
+ ** /.pymodhis
Original file line number Diff line number Diff line change 1
1
Version 2.0.2
2
2
-----------------------------------------------------------
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.
6
7
7
8
Version 2.0.1
8
9
-----------------------------------------------------------
Original file line number Diff line number Diff line change @@ -512,15 +512,22 @@ def _send(self, request):
512
512
return 0
513
513
514
514
def _wait_for_data (self ):
515
+ size = 0
516
+ more_data = False
515
517
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 )
517
521
else :
518
522
condition = partial (lambda dummy1 , dummy2 : True , dummy2 = None )
519
523
start = time .time ()
520
524
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 ) :
523
527
break
528
+ if avaialble and avaialble != size :
529
+ more_data = True
530
+ size = avaialble
524
531
time .sleep (0.01 )
525
532
return size
526
533
Original file line number Diff line number Diff line change @@ -274,11 +274,6 @@ def sendPacket(self, message):
274
274
_logger .debug ("Sleeping" )
275
275
time .sleep (self .client .silent_interval )
276
276
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
-
282
277
self .client .last_frame_end = round (time .time (), 6 )
283
278
return size
284
279
You can’t perform that action at this time.
0 commit comments