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)
1856
1856
return ctx -> backend -> header_length ;
1857
1857
}
1858
1858
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
+
1859
1869
int modbus_enable_quirks (modbus_t * ctx , uint32_t quirks_mask )
1860
1870
{
1861
1871
if (ctx == NULL ) {
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ MODBUS_API int
206
206
modbus_set_indication_timeout (modbus_t * ctx , uint32_t to_sec , uint32_t to_usec );
207
207
208
208
MODBUS_API int modbus_get_header_length (modbus_t * ctx );
209
+ int modbus_get_query_function (modbus_t * ctx , const uint8_t * req );
209
210
210
211
MODBUS_API int modbus_connect (modbus_t * ctx );
211
212
MODBUS_API void modbus_close (modbus_t * ctx );
You can’t perform that action at this time.
0 commit comments