Skip to content

Fix IllegalArgumentException - #17

Open
da-Kai wants to merge 11 commits into
developmentfrom
feature/fix-illegal-argument-exception
Open

Fix IllegalArgumentException#17
da-Kai wants to merge 11 commits into
developmentfrom
feature/fix-illegal-argument-exception

Conversation

@da-Kai

@da-Kai da-Kai commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Fix serial timing and refactor transmission delay handling

Changes:

  • Fix nanosecond timeout value out of range exceptions in Thread.sleep()
  • Fix serial throughput calculation by including start bit and fix end-bit retreval
  • Extract sleep fudge factors into named constants (LONG_DELAY_FUDGE_FACTOR, SHORT_DELAY_FUDGE_FACTOR)
  • Add getBitsPerCharacter() and getStopBits() to AbstractSerialConnection
  • Add baud rate validation (>= 1) to prevent division-by-zero
  • Refactor SerialParameters constructors to use proper delegation chain
  • Rename DEFAULT_RS485_TX_DURING_RX → DEFAULT_RS485_RX_DURING_TX for clarity

grafik

make shure milli and nano values are in range
@da-Kai
da-Kai requested review from Copilot and removed request for Copilot July 31, 2026 06:54

This comment was marked as outdated.

da-Kai added 4 commits August 11, 2026 12:34
* move `getBitsPerCharacter` to `AbstractSerialConnection`
* fix stopBits value

This comment was marked as outdated.

This comment was marked as outdated.

da-Kai added 2 commits August 12, 2026 20:46
- Fix getCharIntervalMicro() to correctly return microseconds (was returning nanoseconds due to using NS_IN_A_MS instead of MICROS_IN_A_SEC)
- Refactor SerialParameters constructors to use proper delegation (no-arg → full-arg chain)
- Add baud rate validation (must be >= 1) to prevent division-by-zero in timing calculations
- Rename DEFAULT_RS485_TX_DURING_RX to DEFAULT_RS485_RX_DURING_TX for clarity
- Fix spurious Thread.currentThread().interrupt() calls on non-InterruptedException paths
- Minor log message improvements for waitForTransmission
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.

2 participants