From 19c519eb05d6d24a23fd084a3ab6c1a78edf5536 Mon Sep 17 00:00:00 2001 From: Luc Viala Date: Wed, 25 Aug 2021 13:59:36 +0200 Subject: [PATCH] modbus: copy trans_id & proto_id to response header Copy Transaction and Protocol Identifiers to response header. Signed-off-by: Luc Viala --- subsys/modbus/modbus_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/modbus/modbus_server.c b/subsys/modbus/modbus_server.c index bd0addac356..a8f210560d1 100644 --- a/subsys/modbus/modbus_server.c +++ b/subsys/modbus/modbus_server.c @@ -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;