Skip to content

Commit

Permalink
TCP-to-RTU example: Fix cbTcpRaw
Browse files Browse the repository at this point in the history
  • Loading branch information
emelianov committed Jul 22, 2022
1 parent a0fb81c commit a2d0a50
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Modbus::ResultCode cbTcpRaw(uint8_t* data, uint8_t len, void* custom) {
Serial.printf(" Fn: %02X, len: %d \n\r", data[0], len);

if (transRunning) { // Note that we can't process new requests from TCP-side while waiting for responce from RTU-side.
tcp.setTransactionId(transRunning); // Set transaction id as per incoming request
tcp.setTransactionId(src->transactionId); // Set transaction id as per incoming request
tcp.errorResponce(IPAddress((src->ipaddr), (Modbus::FunctionCode)data[0], Modbus::EX_SLAVE_DEVICE_BUSY);
return Modbus::EX_SLAVE_DEVICE_BUSY;
}
Expand Down

0 comments on commit a2d0a50

Please sign in to comment.