@@ -220,7 +220,7 @@ static int send_msg(modbus_t *ctx, uint8_t *msg, int msg_length)
220220 return rc ;
221221}
222222
223- int modbus_send_raw_request (modbus_t * ctx , const uint8_t * raw_req , int raw_req_length )
223+ int modbus_send_raw_request_tid (modbus_t * ctx , const uint8_t * raw_req , int raw_req_length , long tid )
224224{
225225 sft_t sft ;
226226 uint8_t req [MAX_MESSAGE_LENGTH ];
@@ -242,7 +242,7 @@ int modbus_send_raw_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_l
242242 sft .slave = raw_req [0 ];
243243 sft .function = raw_req [1 ];
244244 /* The t_id is left to zero */
245- sft .t_id = 0 ;
245+ sft .t_id = tid ;
246246 /* This response function only set the header so it's convenient here */
247247 req_length = ctx -> backend -> build_response_basis (& sft , req );
248248
@@ -255,6 +255,11 @@ int modbus_send_raw_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_l
255255 return send_msg (ctx , req , req_length );
256256}
257257
258+ int modbus_send_raw_request (modbus_t * ctx , const uint8_t * raw_req , int raw_req_length )
259+ {
260+ return modbus_send_raw_request_tid (ctx , raw_req , raw_req_length , 0 );
261+ }
262+
258263/*
259264 * ---------- Request Indication ----------
260265 * | Client | ---------------------->| Server |
0 commit comments