modbus: copy trans_id & proto_id to response header

Copy Transaction and Protocol Identifiers to response header.

Signed-off-by: Luc Viala <luc.viala19@gmail.com>
This commit is contained in:
Luc Viala 2021-08-25 13:59:36 +02:00 committed by Christopher Friedt
commit 19c519eb05

View file

@ -950,6 +950,8 @@ bool modbus_server_handler(struct modbus_context *ctx)
}
/* Prepare response header */
ctx->tx_adu.trans_id = ctx->rx_adu.trans_id;
ctx->tx_adu.proto_id = ctx->rx_adu.proto_id;
ctx->tx_adu.unit_id = addr;
ctx->tx_adu.fc = fc;