Skip to content

Conversation

@sansmoraxz
Copy link
Contributor

Improve connection parsing with parsing for floating point values and duration strings. The time duration fields can support integer, float and string values.

Also added fields for automated connection recovery (at least for TCP) with sensible defaults (to not break existing configs)

Fixes: #684
Fixes: #374

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?) NA

Testing Instructions

Added test cases. Also test against real device.

New Dependency Instructions (If applicable)

NA

Signed-off-by: Souyama <souyamadebnath@gmail.com>
Signed-off-by: Souyama <souyamadebnath@gmail.com>
Signed-off-by: Souyama <souyamadebnath@gmail.com>
Signed-off-by: Souyama <souyamadebnath@gmail.com>
Signed-off-by: Souyama <souyamadebnath@gmail.com>
for improved TCP connection handling

Signed-off-by: Souyama <souyamadebnath@gmail.com>
for idle timeout and recovery settings

Signed-off-by: Souyama <souyamadebnath@gmail.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 74.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.51%. Comparing base (2c8c7f3) to head (466598e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/driver/modbusclient.go 0.00% 9 Missing ⚠️
internal/driver/config.go 90.24% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #688      +/-   ##
==========================================
+ Coverage   40.55%   42.51%   +1.95%     
==========================================
  Files           7        7              
  Lines         715      748      +33     
==========================================
+ Hits          290      318      +28     
- Misses        377      381       +4     
- Partials       48       49       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sansmoraxz sansmoraxz changed the title fix: device timing small values and configure TCP connection recovery fix: device timings allow small values and configure TCP connection recovery Dec 1, 2025
@sansmoraxz
Copy link
Contributor Author

@cloudxxx8 thoughts?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use timeout values smaller than 1 sec Change Timeout and IdleTimeout types to time.Duration

2 participants