Skip to content

Commit 19c519e

Browse files
f3dora19cfriedt
authored andcommitted
modbus: copy trans_id & proto_id to response header
Copy Transaction and Protocol Identifiers to response header. Signed-off-by: Luc Viala <[email protected]>
1 parent 2f38c52 commit 19c519e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/modbus/modbus_server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,8 @@ bool modbus_server_handler(struct modbus_context *ctx)
950950
}
951951

952952
/* Prepare response header */
953+
ctx->tx_adu.trans_id = ctx->rx_adu.trans_id;
954+
ctx->tx_adu.proto_id = ctx->rx_adu.proto_id;
953955
ctx->tx_adu.unit_id = addr;
954956
ctx->tx_adu.fc = fc;
955957

0 commit comments

Comments
 (0)