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

- Fixed "responce" typo and other typos in doc and comments #299

Open lmartorella opened 1 year ago

lmartorella commented 1 year ago

Hello, Thanks for this awesome library! It is working perfectly on both ESP8266 and ESP32 cores, so probably it deserves a rename.

However the "responce" typo just let me down a bit, especially since it is quite prominent since exposed in the API. What about a rename? I know that this will change the API, so probably you will be interested in maintaining the backward compatibility. Please let me know if you want to do that, eventually with the usage of __attribute__((deprecated)) in order to raise warnings at compile time.

A whole next level change would be to rename the methods to drop the master/slave naming in favor of client/server (see here], but I noticed there is always something going on, even if is not super-clear to me (it looks inverted in the RTU interface?):

    void client() { isMaster = true; };
    inline void master() {client();}
    void server(uint8_t serverId) {_slaveId = serverId;};
    inline void slave(uint8_t slaveId) {server(slaveId);}
    uint8_t server() { return _slaveId; }
    inline uint8_t slave() { return server(); }

Thanks! L

emelianov commented 1 year ago

Thanks. You are right about leaving typo names API calls marked as deprecated but still available. Could you please add these wrappers to the request?

lmartorella commented 1 year ago

Great, added! Thx, L