kuhrusty
kuhrusty
> I think you have to call modbus_set_slave() before modbus_read_registers() Sure; you have to call `modbus_connect()` before `modbus_read_registers()`, too. Why is it good for one error to fail gracefully while...
> Sidenote: the assert would usually go away when the library is compiled without "debug mode" and then `ctx->slave` is still -1 which would result in `req[0] = 0xff` as...
> I would agree that this is a "don't hold it wrong" and "the handle provided is sharp" but leave asserts on when developing? That's what they're for, and then...
> I think it would be better to make the necessary checks in the wrapper with: > int modbus_get_slave(modbus_t *ctx); > before every call of modbus_read_registers(). But then I also...
Yeah, this is working for us on Debian 8 or 9 to build a static library *instead* of a shared library: $ ./configure --with-pic --enable-static --enable-shared=no