I've decided to use the library for adding Modbus support for fun-project and faced with the issue that it's impossible to set up callback for read/write as a class member. For fixing this I've added the possibility to apply "context" for callback context, which can be later user for forwaring handling procedure into the corresponding instance.
I've decided to use the library for adding Modbus support for fun-project and faced with the issue that it's impossible to set up callback for read/write as a class member. For fixing this I've added the possibility to apply "context" for callback context, which can be later user for forwaring handling procedure into the corresponding instance.
Setup callbackContext:
Add callbacks to the multiplexer:
The full code is available here: https://github.com/ValentiWorkLearning/ReflowTableModbusController/blob/master/src/modbus_server_task.cpp