File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1856,6 +1856,16 @@ int modbus_get_header_length(modbus_t *ctx)
18561856 return ctx -> backend -> header_length ;
18571857}
18581858
1859+ int modbus_get_query_function (modbus_t * ctx , const uint8_t * req )
1860+ {
1861+ if (ctx == NULL ) {
1862+ errno = EINVAL ;
1863+ return -1 ;
1864+ }
1865+
1866+ return req [ctx -> backend -> header_length ];
1867+ }
1868+
18591869int modbus_enable_quirks (modbus_t * ctx , uint32_t quirks_mask )
18601870{
18611871 if (ctx == NULL ) {
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ MODBUS_API int
206206modbus_set_indication_timeout (modbus_t * ctx , uint32_t to_sec , uint32_t to_usec );
207207
208208MODBUS_API int modbus_get_header_length (modbus_t * ctx );
209+ int modbus_get_query_function (modbus_t * ctx , const uint8_t * req );
209210
210211MODBUS_API int modbus_connect (modbus_t * ctx );
211212MODBUS_API void modbus_close (modbus_t * ctx );
You can’t perform that action at this time.
0 commit comments