Skip to content

Commit e0aa79b

Browse files
committed
TCP-to-RTU example: Fix timeout processing
1 parent dc1a79a commit e0aa79b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/Bridge/TCP-to-RTU-Simulator/TCP-to-RTU-Simulator.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ bool cbTcpTrans(Modbus::ResultCode event, uint16_t transactionId, void* data) {
3737
Serial.printf("Modbus result: %02X, Mem: %d\n", event, ESP.getFreeHeap()); // Display Modbus error code (222527)
3838
if (event == Modbus::EX_TIMEOUT) { // If Transaction timeout took place
3939
tcp.disconnect(tcp.eventSource()); // Close connection
40+
transRunning = 0;
41+
slaveRunning = 0;
4042
}
4143
return true;
4244
}

0 commit comments

Comments
 (0)