Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0aa79b

Browse filesBrowse files
committed
TCP-to-RTU example: Fix timeout processing
1 parent dc1a79a commit e0aa79b
Copy full SHA for e0aa79b

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

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

Copy file name to clipboardExpand all lines: examples/Bridge/TCP-to-RTU-Simulator/TCP-to-RTU-Simulator.ino
+2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.