File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1357,13 +1357,16 @@ int modbus_proxy(modbus_t *frontend_ctx,
13571357 memcpy (backend_req , req + frontend_header_length - 1 , pdu_length + 1 );
13581358 backend_req_length = pdu_length + 1 ;
13591359
1360- /* Preserve the transaction ID from the frontend request */
1360+ /* Keep the transaction ID of the frontend request to restore it in the
1361+ response sent to the frontend */
13611362 sft .slave = backend_req [0 ];
13621363 sft .function = backend_req [1 ];
13631364 sft .t_id = frontend_ctx -> backend -> get_response_tid (req );
13641365
13651366 /* Send the request to the backend device using raw request.
1366- modbus_send_raw_request_tid wraps the PDU into the backend framing. */
1367+ modbus_send_raw_request_tid wraps the PDU into the backend framing.
1368+ The backend request uses transaction ID 0 and the pre-check of the
1369+ confirmation below relies on it (check_sft.t_id) */
13671370 rc = modbus_send_raw_request_tid (
13681371 backend_ctx , backend_req , backend_req_length , 0 );
13691372 if (rc == -1 ) {
You can’t perform that action at this time.
0 commit comments