-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correct response size calculation for modbus functions
- Fix incorrect quantity extraction leading to truncated responses and timeouts - Add get_u16_from_request helper for safe byte extraction from request frames - Add get_quantity function to properly handle quantity based on function code: - Read functions (0x01-0x04) and write multiple (0x0F, 0x10): extract from bytes 4-5 - Write single functions (0x05, 0x06): fixed quantity of 1 - Other functions: default to quantity 1 - Improve error handling for malformed request frames
- Loading branch information
Showing
2 changed files
with
121 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters