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
uint8_t addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
62
-
Udp.write(inBuffer[addressPos]); // address
63
-
Udp.write(inBuffer[addressPos + 1] + 0x80); // function + 0x80
61
+
byte addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
62
+
Udp.write(inBuffer[addressPos]); // address
63
+
Udp.write(inBuffer[addressPos + 1] + 0x80); // function + 0x80
uint8_t addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
byte addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
uint8_t addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
153
-
if (localConfig.enableRtuOverTcp) { // check CRC for Modbus RTU over TCP/UDP
byte addressPos = 6 * !localConfig.enableRtuOverTcp; // position of slave address in the incoming TCP/UDP message (0 for Modbus RTU over TCP/UDP and 6 for Modbus RTU over TCP/UDP)
153
+
if (localConfig.enableRtuOverTcp) { // check CRC for Modbus RTU over TCP/UDP
154
154
if (checkCRC(inBuffer, msgLength) == false) {
155
155
errorCount[ERROR_TCP]++;
156
156
return0; // drop request and do not return any error code
if (W5100.readSnSR(sock) == SnSR::ESTABLISHED && W5100.readSnDPORT(sock) == myHeader.remPort) { // Check remote port should be enough or check also rem IP?
192
192
if (localConfig.enableRtuOverTcp) client.write(PDU, pduLength);
0 commit comments