modbus.h from <=3.0.x:
void modbussetresponsetimeout(modbust ctx, const struct timeval timeout);
void modbussetbytetimeout(modbust ctx, const struct timeval timeout);
while >= modbus 3.1.0 has:
MODBUSAPI int modbussetresponsetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
MODBUSAPI int modbussetbytetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
This gives this these compilation errors in mb2hal.c:
hal/usercomps/mb2hal/mb2hal.c: In function ‘gettx_connection’:
hal/usercomps/mb2hal/mb2hal.c:362:55: warning: passing argument 2 of ‘modbussetresponsetimeout’ makes integer from pointer without a cast [-Wint-conversion]
modbussetresponsetimeout(thismb_link->modbus, &timeout);
^
In file included from hal/user_comps/mb2hal/mb2hal.h:18:0,
from hal/user_comps/mb2hal/mb2hal.c:27:
/usr/include/modbus/modbus.h:188:16: note: expected ‘uint32_t {aka unsigned int}’ but argument is of type ‘struct timeval *’
MODBUSAPI int modbussetresponsetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
^
hal/usercomps/mb2hal/mb2hal.c:362:5: error: too few arguments to function ‘modbussetresponsetimeout’
modbussetresponsetimeout(thismb_link->modbus, &timeout);
^
In file included from hal/user_comps/mb2hal/mb2hal.h:18:0,
from hal/user_comps/mb2hal/mb2hal.c:27:
/usr/include/modbus/modbus.h:188:16: note: declared here
MODBUSAPI int modbussetresponsetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
^
hal/usercomps/mb2hal/mb2hal.c:369:51: warning: passing argument 2 of ‘modbussetbytetimeout’ makes integer from pointer without a cast [-Wint-conversion]
modbussetbytetimeout(thismb_link->modbus, &timeout);
^
In file included from hal/user_comps/mb2hal/mb2hal.h:18:0,
from hal/user_comps/mb2hal/mb2hal.c:27:
/usr/include/modbus/modbus.h:191:16: note: expected ‘uint32_t {aka unsigned int}’ but argument is of type ‘struct timeval *’
MODBUSAPI int modbussetbytetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
^
hal/usercomps/mb2hal/mb2hal.c:369:5: error: too few arguments to function ‘modbussetbytetimeout’
modbussetbytetimeout(thismb_link->modbus, &timeout);
^
In file included from hal/user_comps/mb2hal/mb2hal.h:18:0,
from hal/user_comps/mb2hal/mb2hal.c:27:
/usr/include/modbus/modbus.h:191:16: note: declared here
MODBUSAPI int modbussetbytetimeout(modbust *ctx, uint32t tosec, uint32t to_usec);
^
make: * [Makefile:207: objects/hal/user_comps/mb2hal/mb2hal.o] Error 1