Skip to content

drivers/generic_modbus.{c,h}: fix compilation warnings#1107

Merged
jimklimov merged 6 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-generic-modbus
Sep 24, 2021
Merged

drivers/generic_modbus.{c,h}: fix compilation warnings#1107
jimklimov merged 6 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-generic-modbus

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Sep 23, 2021

Follows up from #1052 to clean up compilation warnings.

CC @dtsecon - in original PR I asked whether generic types like "int" should become specific-bitness types to match wire protocol, etc.? If there is something to fix, please base that over this cleaned-up code :)

Also, ser_parity is not sanity-checked (at least when received from config); should it be? Any others?

UPDATE: CI likes the change so I'll merge it now; feel free to post further PRs based on NUT master branch.

@jimklimov jimklimov changed the title drivers/generic_modbus.{c,h}: fix whitespace style drivers/generic_modbus.{c,h}: fix compilation warnings Sep 23, 2021
@jimklimov jimklimov merged commit 2d5423b into networkupstools:master Sep 24, 2021
@jimklimov jimklimov deleted the fightwarn-generic-modbus branch September 24, 2021 14:54
@jimklimov
Copy link
Copy Markdown
Member Author

Also if possible, can you test the updated driver in master branch against your device, to make sure I did not add typos etc?

@dtsecon
Copy link
Copy Markdown
Contributor

dtsecon commented Sep 29, 2021

I'm sorry for my delayed response. I didn't have the chance to review the committed changes due to my involvement in other business activities. I will check and give some feedback

@dtsecon
Copy link
Copy Markdown
Contributor

dtsecon commented Dec 9, 2021

I have done some testing based on code from master branch. It seems to work fine, however I've made some improvements. Driver now handles connection errors (broken pipe) with modbus tcp server devices. I noticed also that there might be cases with modbus tcp devices, where invalid data are received (shifted data frames) due to tight time intervals between requests. So I've added some code to configure the response time out between requests and between frame bytes. The new code is under testing. When it's done should I commit these modifications within this PR?

@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Dec 10, 2021 via email

@dtsecon
Copy link
Copy Markdown
Contributor

dtsecon commented Dec 23, 2021

I have tested the code and committed the changes into the current fork (PR). Is that ok or should I open a new PR?

@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Dec 25, 2021 via email

@jimklimov jimklimov added modbus refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modbus refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants