emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.
Other
534 stars 190 forks source link

Callback #371

Open hugoinfante83 opened 6 days ago

hugoinfante83 commented 6 days ago

Is it possible to improve callback? instead of bool cbf0(Modbus::ResultCode event, uint16_t transactionId, void data) to bool cbfx(Modbus::ResultCode event, uint16_t transactionId, void data, int idSlave)

in case of multiples slaves inside the call back would be there the idSlave and would make it easier to work on the errors.

the transationid is just that...

emelianov commented 4 days ago

You can use mb.eventSource() inside callback to get slaveid processed.