Skip to content

feat(Modbus): add WriteCoilAsync function#16

Merged
ArgoZhang merged 5 commits into
mainfrom
feat-modbus
Sep 4, 2025
Merged

feat(Modbus): add WriteCoilAsync function#16
ArgoZhang merged 5 commits into
mainfrom
feat-modbus

Conversation

@ArgoZhang

Copy link
Copy Markdown
Member

Link issues

fixes #15

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Copilot AI review requested due to automatic review settings September 4, 2025 05:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds asynchronous single coil write functionality to the Modbus TCP client by implementing the WriteCoilAsync method. The changes simplify the interface by removing unused synchronous methods and focus on providing a clean async-only API.

  • Implements WriteCoilAsync method for writing single coil values asynchronously
  • Adds BuildWriteRequest method to support write operations in the message builder
  • Removes unused synchronous methods and simplifies the interface

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/UnitTestModbus/TcpClientTest.cs Adds unit test for the new WriteCoilAsync functionality
src/Longbow.Modbus/ModbusMessageBuilder.cs Renames existing method and adds BuildWriteRequest for write operations
src/Longbow.Modbus/IModbusTcpClient.cs Updates interface to include WriteCoilAsync and removes unused methods
src/Longbow.Modbus/DefaultModbusTcpClient.cs Implements WriteCoilAsync and supporting write functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/UnitTestModbus/TcpClientTest.cs
Comment thread src/Longbow.Modbus/ModbusMessageBuilder.cs
Comment thread src/Longbow.Modbus/DefaultModbusTcpClient.cs
@ArgoZhang ArgoZhang merged commit 5b72cf9 into main Sep 4, 2025
1 check passed
@ArgoZhang ArgoZhang deleted the feat-modbus branch September 4, 2025 05:13
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.

feat(Modbus): add WriteCoilAsync function

2 participants