You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why do we not simply define a serial timeout which defines the "receive window" and simply wait for a timeout or invalid data (which is accounted for by ModbusUtils.DetectFrame)? Per definition a Modbus frame should arrive as a continuous block (please correct me if I'm wrong).
Currently the implementation may get stuck in the while loop if we receive a continuous data stream via the serial port which is not detected as a valid frame (as the buffer will be reset if it is full). At least, we should handle a full frame buffer differently.
Same applies to the async version.
The text was updated successfully, but these errors were encountered:
Hi,
is there a reason, why we read the incoming frame in a while loop? Looks potentially dangerous to me.
while (true)
Why do we not simply define a serial timeout which defines the "receive window" and simply wait for a timeout or invalid data (which is accounted for by ModbusUtils.DetectFrame)? Per definition a Modbus frame should arrive as a continuous block (please correct me if I'm wrong).
Currently the implementation may get stuck in the while loop if we receive a continuous data stream via the serial port which is not detected as a valid frame (as the buffer will be reset if it is full). At least, we should handle a full frame buffer differently.
Same applies to the async version.
The text was updated successfully, but these errors were encountered: