feat: support FC22 in servers - #619
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughModbus serial and TCP servers now support Modbus function code 22, including typed vector handlers, callback/Promise/synchronous execution, response generation, error handling, examples, and protocol tests. ChangesModbus FC22 mask-write support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ModbusClient
participant ModbusServer
participant maskWriteRegister
participant setRegisterMask
ModbusClient->>ModbusServer: Send FC22 request
ModbusServer->>maskWriteRegister: Dispatch request
maskWriteRegister->>setRegisterMask: Pass address and masks
setRegisterMask-->>maskWriteRegister: Complete or return error
maskWriteRegister-->>ModbusClient: Echo response or exception
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/server.js`:
- Line 25: Update the setRegisterMask function signature in the example to
accept unitID as the fourth parameter after addr, andMask, and orMask, and
include it in the existing log output so the example matches the FC22 invocation
contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a81a4d26-580e-43e2-bc6b-8a4a31656b4e
📒 Files selected for processing (10)
README.mdServerTCP.d.tsexamples/server.jsservers/serverserial.jsservers/servertcp.jsservers/servertcp_handler.jstest/servers/serverserial.test.jstest/servers/servertcp.test.jstest/servers/servertcpCallback.test.jstest/servers/servertcpPromise.test.js
|
Thank you for the pull request 💚 please address the automatic comment |
|
Is it possible to get a npm release ? Thanks |
Problem
Solution
setRegisterMaskto the server vector.Tests
Documentation
Summary by CodeRabbit
setRegisterMaskimplementations.setRegisterMask.