Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API documentation unclear #273

Open
rob040 opened this issue Mar 13, 2023 · 0 comments
Open

API documentation unclear #273

rob040 opened this issue Mar 13, 2023 · 0 comments

Comments

@rob040
Copy link

rob040 commented Mar 13, 2023

I think this library can do everything I need, however, the documentation in the API.md file and the lack of documentation in the source code makes it hard to understand.

  • The API.md says that the master() function is TCP specific in the server API section. I'm missing this for RTU mode but the RTU-master example shows that it is needed. So, this must be missing from the RTU API doc.
  • The current class definition public methods have zero comments. Adding function level documentation would allow for generating API documentation from code, automatically updated when functionality changes. Checkout Doxygen for that.
  • The file ModbusAPI.h, a file that screams I'm very important, is about as unreadable as it can get with its templates and multi-line macros and zero comments.
  • The double old+new (politically corrected) naming for master/slave, which also run double duty (master/slave mode selection AND slave/master interrogate (?)) is quite confusing.
  • Source code with a mix of tabs and spaces, where the tab settings differ from my editor, makes it harder to follow the code because indentation is off (I quickly run 'Format document' on it to get uniformity on indents and braces)
  • It is unclear to me of what is the full set of methods available once master or slave mode is selected and communication method (RTU/TCP) and communication interface (RS485/Wifi/Ethernet) has been chosen. It appears to me that there is no limitation of combination errors the library user can make. It would be helpful when e.g. through conditional compiling, non-selected modes would inhibit the use (compile, linking AND intellisense hints) of invalid classes and methods.
  • wrt modbus functions, the actual used modbus function code is only occasionally mentioned in the API doc. Room for improvement.
  • When different terminology than standard Modbus is used, it will be helpful if there are pointers to the documented terminology.
  • It is unknown to me, and it is nowhere described, but where do the push/pull methods differ from read/write methods.
  • and what are the ...IststoCoil and ...CoiltoIsts and HregtoIreg and IregtoHreg methods doing?
  • There is mention of "local registers". Is that some caching method? How to use?
  • Which modbus methods are or can be Blocking ?
  • file modbusSettings.h contain compiletime settings, however, it is part of the library, which normally is read-only.

Care to respond on these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants